caven xuPro Student 13,400 Points
How about separately writing `new` `create` in comments_controller ?
I 'noticed that we can use different ways to create a comment.
use the way in this video:
@post.comments.newin posts/show, then call
[@post, comment]in partial;
form_for @post.comments.new do |f|in partial
another way is create a views/comments/new then write
@post = Post.find(params[:post_id]), @comment = @post.comments.new) in comments_controller, finally call
@comment in view
I haven't seen the first way before. Is this shorthand method new to rails? Which one is more usual in production?