Skip to content
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

Model for nested attributes not being saved #952

Closed
swigrid opened this issue Sep 7, 2017 · 2 comments
Closed

Model for nested attributes not being saved #952

swigrid opened this issue Sep 7, 2017 · 2 comments

Comments

@swigrid
Copy link

swigrid commented Sep 7, 2017

Hi

I have Customer model which has_many Addresses. I'm trying to send params from API client like this:

{"confirm_success_url"=>"", "commit"=>"Register", "email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "first_name"=>"Matt", "last_name"=>"Dee", "addresses"=>[{"addr_type"=>"home", "line1"=>"47 Westhill rd."}]}.

I have tried it also like this

"addresses_attributes"=>{"0"=>{"addr_type"=>"home", "line1"=>"asdf", "line2"=>"asdf", "city"=>"asdf", "post_code"=>"asdf"}}}

"addresses"=>{"addr_type"=>"home", "line1"=>"asdf", "line2"=>"asdf", "city"=>"asdf", "post_code"=>"asdf"}}

I'm not sure if this is an issue or I'm doing it wrong.

@swigrid
Copy link
Author

swigrid commented Sep 7, 2017

I'm sorry, I didn't release that this is Devise responsibility.

https://github.com/plataformatec/devise#strong-parameters

@swigrid swigrid closed this as completed Sep 7, 2017
@newfylox
Copy link

@swigrid Did you manage to do this? I'm stuck to the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants