Class: CommentsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/comments_controller.rb', line 4

def create
  @comment = Comment.new(
    comment_params.merge(user: current_user)
  )
  if @comment.save
    @ticket = @comment.ticket
    @activity = @ticket.create_activity key: "ticket.create_comment", owner: current_user, recipient: @comment
  end

  respond_to do |format|
    format.js
  end
end