Class: BlogBoi::CommentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/blog_boi/comments_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_admin

Instance Method Details

#createObject



7
8
9
10
11
12
# File 'app/controllers/blog_boi/comments_controller.rb', line 7

def create
  @article = Article.find(params[:article_id])
  @comment = @article.comments.create(comment_params)
  flash[:notice] = "Comment has been created!"
  redirect_to articles_path
end