<%= form_for([@post, @post.comments.build]) code example Example: <%= form_for([@post, @post.comments.build]) <%= form_for([@post, @post.comments.build])