I am using a nested form ( User has_one Account .. to hold profile data) to UPDATE my user/account data
User model has_one :account accepts_nested_attributes_for :account, :allow_destroy => true
Account model belongs_to :user
I am using a nested form ( User has_one Account .. to hold profile data) to UPDATE my user/account data
User model has_one :account accepts_nested_attributes_for :account, :allow_destroy => true
Account model belongs_to :user
The account data must be in :user => {:account_attributes => {...}} if you want auto save it.
You can read about it in the documentation of ActiveRecord::NestedAttributes::ClassMethods (see fields_for in ActionView::Helpers::FormHelper too).
Regards.
Franco Catena.
thanks Franco, .. I was hitching my head and just discover in the log :
WARNING: Can't mass-assign these protected attributes: account
so this attribute was wrong... and you gave me the answer !!