Class: CommentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- CommentsController
- Defined in:
- lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
9 10 11 12 13 |
# File 'lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb', line 9 def create @comment = @commentable.comments.new comment_params @comment.save! redirect_to [@commentable], notice: "Comment created" end |
#index ⇒ Object
5 6 7 |
# File 'lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb', line 5 def index @comments = @commentable.comments end |