I am learning rails and have recently come across a road block. Any guidance is appreciated.
I am using device and I have a :confirmed_at
DateTime column as a protected attribute. So to update it from my admin interface I super the controller update method and add:
@user.update_attribute(:confirmed_at, params[:user][:confirmed_at])
@user.update_attribute(:school_id, params[:user][:school_id])
:school_id
gets update correctly but :confirmed_at
, which is datetime, is always nil. I looked at the params hash and sure enough it does not have :confirmed_at
but it has
"confirmed_at(1i)"=>"2012",
"confirmed_at(2i)"=>"6",
"confirmed_at(3i)"=>"2",
"confirmed_at(4i)"=>"04",
"confirmed_at(5i)"=>"11"
Rails doesn't seem to be translating the parameters for the fields into datetime objects for the database.
** How do I capture these value to update my :confirmed_at
field properly?
Any help is appreciated.
Rails 3.1, Ruby 1.9