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
| Attachment | Size |
|---|---|
| date_helper.txt | 36.08 KB |