Class: Bbs::CommentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Bbs::CommentsController
- Defined in:
- app/controllers/bbs/comments_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/bbs/comments_controller.rb', line 6 def create @comment = @topic.comments.build(comment_params) if @comment.save redirect_to bbs.topic_comments_path(@topic), notice: t('.success') else redirect_back fallback_location: bbs.topic_comments_path(@topic), alert: @comment.errors. end end |
#index ⇒ Object
16 17 18 19 |
# File 'app/controllers/bbs/comments_controller.rb', line 16 def index @comment = @topic.comments.build @comments = comments end |