0

I have a user model and language model where the language model contains list of languages and the user model contains the information of the user. In user model there is a field called language where the user should select a language from the language model. And for all these i do not have form and i want to pass the id of the language when creating new user and it should save the language for the user. I use curl to create and update.

So please tell me how i can do this? Please help me.

Thanks in advance.

1 Answer 1

0

I think nested attribute is what you need. You can learn more about it here : Active Record Nested Attributes

Additionally for simulating nested attribute calls using curl, you can look at this post :

Simulate a form post with nested resources arrays using curl

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.