Class: CommentsController

Inherits:
ApplicationController show all
Defined in:
lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#prepare_meta_tags

Instance Method Details

#createObject



11
12
13
14
15
# File 'lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb', line 11

def create
  @comment = @commentable.comments.new comment_params
  @comment.save!
  redirect_to [@commentable], notice: 'Comment created'
end

#indexObject



7
8
9
# File 'lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb', line 7

def index
  @comments = @commentable.comments
end