Platinum Solutions Corporate Website


The answer you entered to the math problem is incorrect.

Fix for date_select in Rails 2.0.2

If you are using Rails 2.0.2 you may notice that you get an Internal Server Error when you do something like this:

<%# fields_for "child[]", Interest.new do |f|%>
<%= f.text_field :name %>
<%= f.date_select :birth %>
<%# end %>

I'm doing something similar to that example and I found out there is a patch scheduled for rails 2.0.3. If you can't wait for the fix then you can add the patch to the stable code base yourself (unfortunately, the fix isn't available in "edge rails" yet).

All you have to do is run "rake rails:freeze:gems" and that will install source code for the stable version of rails into the vendor directory. Then go to the date_helper class located at actionpack/lib/action_view/helpers/date_helper.rb and add the following line in the options_with_prefix method after line 648:
"elsif defined?(@auto_index)" and you are done!

I have attached the fix just in case you just want to replace the existing file with the fix.

For more information on the bug and working with edge rails vs gem rails, check out the following links:

http://dev.rubyonrails.org/ticket/10551
http://wiki.rubyonrails.org/rails/pages/EdgeRails

AttachmentSize
date_helper.txt36.08 KB

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2.
The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options