Class: RailsExecution::CommentsController
Instance Method Summary
collapse
#can_close_task?, #can_create_task?, #can_edit_task?, #can_execute_task?, #display_decide?, #display_owner?, #display_reviewers?, #how_to_executable, #in_solo_mode?, #show_form_sidebar?
Methods included from BaseHelper
#current_owner
Instance Method Details
#create ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'app/controllers/rails_execution/comments_controller.rb', line 6
def create
@new_comment = current_task..new(owner: current_owner, content: params.dig(:comment, :content))
if @new_comment.save
::RailsExecution.configuration.notifier.new(current_task).(current_owner, @new_comment.content)
current_task.activities.create(owner: current_owner, message: "Added a comment: #{@new_comment.content.truncate(30)}")
else
@alert = "Your comment can't adding!"
end
end
|
#update ⇒ Object
16
17
18
19
20
|
# File 'app/controllers/rails_execution/comments_controller.rb', line 16
def update
@comment =
@comment.update(content: params.dig(:comment, :content))
respond_to(&:js)
end
|