accepts_nested_attributes_for and Active Resource
I'd like to use accepts_nested_attributes_for with Active Resource. Is this possible? I have been experimenting in console and passing in nested attributes works, however the nested models fail to create because the foreign_key is never set.
For example,
I have a user class that accepts_nested_attributes_for 开发者_高级运维:credentials. The JSON comes across as
"user" => { "name" => "Joe", "credentials" => ["username" => "joe", "password" => "password"]}
, so I copied that into console, but the credential validation fails since user_id is never set.
Is there a way to do this?
精彩评论