Class: Wf::CommentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Wf::CommentsController
- Defined in:
- app/controllers/wf/comments_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
17 18 19 20 21 |
# File 'app/controllers/wf/comments_controller.rb', line 17 def create @workitem = Wf::Workitem.find(params[:workitem_id]) Wf::CaseCommand::AddComment.call(@workitem, params[:comment][:body], wf_current_user) redirect_to workitem_path(@workitem), notice: "Comment Added." end |
#destroy ⇒ Object
23 24 25 26 27 28 |
# File 'app/controllers/wf/comments_controller.rb', line 23 def destroy @workitem = Wf::Workitem.find(params[:workitem_id]) @comment = @workitem.comments.find(params[:id]) @comment.destroy render js: "window.location.reload()" end |
#new ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/wf/comments_controller.rb', line 9 def new @workitem = Wf::Workitem.find(params[:workitem_id]) @comment = @workitem.comments.new @workitem.workflow.name, workflow_path(@workitem.workflow) @workitem.case.name, workflow_case_path(@workitem.workflow, @workitem.case) @workitem.name, workitem_path(@workitem) end |