Answer the question
In order to leave comments, you need to log in
Correct form organization for nested resources?
There is a :posts resource and there is a :tags resource nested within it.
When I create a post, I want to immediately add tags to it, doing it with a form
<%= form_for [@post, @tag] do |form| %>
....
@post = Post.new
@tag = @post.tags.build
...
@post
it has id == nil, i.e. post has not been created yet. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question