problem date_select with active_form

Amar Daxini wrote:

Aldo Italo wrote:

any idea?

Check your params[:contact] how it passes
check params period how it passed
or you can do this thing make setter method combine this hash 3 value

my errors:
/...../vendor/plugins/active_form/lib/active_form.rb:17:in `[]='
/...../vendor/plugins/active_form/lib/active_form.rb:6:in `initialize'
/...../vendor/plugins/active_form/lib/active_form.rb:5:in `each'
/...../vendor/plugins/active_form/lib/active_form.rb:5:in `initialize'
/...../app/controllers/front/sections_controller.rb:60:in `new'
/...../app/controllers/front/sections_controller.rb:60:in `form_contact'



What type is the column period in the database?


I'm out of my comfort zone in that case, I guess it is expecting
FormContact to have a DateTime field called period. I don't know how
you would handle that.


First, you do not need a plug-in to get a date in a form. The fact
that you're using one, though, is irrelevant to the issue.

Next, look at the params hash which you're getting. It clearly has
the date as September 17, 2009, which is in the "period" hash as:


You have to understand that the "period" hash has three parts,
identified as period(1i), period(2i), and period(3i), representing the
year, month, and day, respectively.

Accordingly, if your controller included something like:

@p = params[:period]

you would then be able to identify the respective portions of the

So, what's the problem?


If you are trying to mass assign an attribute that does not exist to
an instance of your model, you need to create a virtual attribute