-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem saving resource using form.fields_for #258
Problem saving resource using form.fields_for #258
Comments
Hi all, My User model My form can even nest another level down, Her handle's it and objects in my controller are updated perfectly:
However, Her seems to just send user[posts] - so the models in my API, which are ActiveRecord models, with their own It's also sending the object of the belongs_to association as an attribute of the POST data. For example:
I'm not sure why Unless I'm doing something obviously wrong, it looks like I'm going to have to give up with using Her and re-write everything as a single Rails app. thanks for reading. |
Hi all,
I have a couple of models, User and Post.
A user has_many :posts, and I've set this up with Her (I can hit /users/1 and /posts/1 to fetch those resources).
In my API, the User model has this:
And in my HER app, I have a view like:
The form renders perfectly, with field names like user[posts_attributes][0][title], however when I try to create a post, Her doesn't send the request to my API and instead returns this error:
It seems to be related to the
to_params(attributes, changes={})
call inparse.rb
, this line in particular returns nil:For some reason, embedded params returns nil and
filtered_attributes.merge!
raises the exception.Anybody else had similar issues? Any help much appreciated!
Rails version 4.1.1, Her 0.7.2
The text was updated successfully, but these errors were encountered: