Rails ActiveRecord::MultiparameterAssignmentErrors
- by Neil Middleton
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?