Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
before_action :set_post
def create
@post.comments.create! comments_params
redirect_to @post
end
def set_post
@post = Post.find(params[:post_id])
end
def comments_params
params.required(:comment).permit(:body)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.