Rails ActiveRecord::MultiparameterAssignmentErrors

Posted by Neil Middleton on Stack Overflow See other posts from Stack Overflow or by Neil Middleton
Published on 2010-03-29T22:49:56Z Indexed on 2010/03/29 22:53 UTC
Read the original article Hit count: 342

Filed under:
|

I have the following code in my model:

attr_accessor :expiry_date
validates_presence_of :expiry_date, :on        => :create, :message => "can't be blank"

and the following in my view:

<%= date_select :account, :expiry_date, :discard_day => true, :start_year => Time.now.year, :end_year => Time.now.year + 15, :order => [:month, :year]  %>

However, when I submit my form I get:

ActiveRecord::MultiparameterAssignmentErrors in SignupController#create

/Users/x/.rvm/gems/ruby-1.8.6-p383/gems/activerecord-2.3.5/lib/active_record/base.rb:3073:in `execute_callstack_for_multiparameter_attributes'
/Users/x/.rvm/gems/ruby-1.8.6-p383/gems/activerecord-2.3.5/lib/active_record/base.rb:3028:in `assign_multiparameter_attributes'
/Users/x/.rvm/gems/ruby-1.8.6-p383/gems/activerecord-2.3.5/lib/active_record/base.rb:2750:in `attributes='
/Users/x/.rvm/gems/ruby-1.8.6-p383/gems/activerecord-2.3.5/lib/active_record/base.rb:2438:in `initialize'

Any ideas as to what the problem might be? I've looked at #93277 with no joy, so am kinda stuck.

Adding day to the select does NOT resolve the issue.

Any ideas?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby