1 class IssueCommentsController < ApplicationController
4 before_action :authorize_web
5 before_action :require_user
6 before_action :check_permission
9 @issue = Issue.find(params[:issue_id])
10 comment = @issue.comments.build(issue_comment_params)
11 comment.user = current_user
12 # if params[:reassign]
14 # @issue_comment.reassign = true
17 notice = t("issues.comment.comment_created")
18 redirect_to @issue, :notice => notice
23 def issue_comment_params
24 params.require(:issue_comment).permit(:body)
28 unless current_user.administrator? || current_user.moderator?
29 flash[:error] = t("application.require_admin.not_an_admin")