Hi JB,
On May 21, 4:24 pm, John Butler <[email protected]>
wrote:
> Im having an issue with accepts_nested_attributes_for for a has_one
> relationship. I have posted the code below and the parameters sent to
> the create but this is not saving the user_detail association record.
>
View code looks fine at a glance especially as it's producing the
right params below.
> "user"=>{"user_detail_attributes"=>{"website_url"=>"www.bbc.co.uk"},
> "commit"=>"Sign up"}
I would try doing the equivalent on the Rails console, so just loading
a user object, setting 'user_detail_attributes' attribute, then saving
and see if that works so any view/controller code can be ruled out.
Also I think posting the code in the controller's create action would
be useful. Could possibly be an interaction with attr_accessible so I
would temporarily disable that to see if it makes a difference.
Hope that helps,
Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---