On 3 Apr 2009, at 13:38, Jim Burgess wrote:
>
> Hi,
>
> I'm writing a form where the user should enter their date of birth.
>
> Here's the code:
>
> <% form_for :applicant, :url=> {:action => "index"} do |f| %>
> ...
> <%= f.label :dob, "Date of Birth" %>
> <%= f.date_select :dob, :include_blank => true %>
> ..
> <p><%= submit_tag "Submit" %></p>
> <% end %>
>
> When I open the form in my browser everything is fine.
> However when I select "February" as the month, "31" as the day, don't
> select a year, and then press "Submit" I get the following error
> message:
>
> 1 error(s) on assignment of multiparameter attributes
>
> Can anyone tell me why this is happening and how to avoid this?
because rails is just faithfully passing this down and trying to
create a date object for 31st february.
update_attributes, Applicant.new etc. will raise
ActiveRecord::MultiparameterAssignmentErrors when this happens.
Fred
>
> Thanks in advance.
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---