Add comments'

This commit is contained in:
Ryan W
2021-12-16 14:33:08 -08:00
parent 4edabe6ab1
commit 3a146f7f60
15 changed files with 97 additions and 5 deletions
+13
View File
@@ -0,0 +1,13 @@
class CommentsController < ApplicationController
before_action :set_article
def create
@article.comments.create! params.required(:comment).permit(:content)
redirect_to @article
end
private
def set_article
@article = Article.find(params[:article_id])
end
end