Class: Rankit::CommentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Rankit::CommentsController
- Defined in:
- app/controllers/rankit/comments_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/rankit/comments_controller.rb', line 15 def create @comment = @rankable.comments.build(comment_params) @comment.user = current_user if @comment.save redirect_to rankit.rankable_comments_path(@rankable) end end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/rankit/comments_controller.rb', line 7 def index @comments = @rankable.comments.order('created_at DESC') end |