Add thank you note to rfc

This commit is contained in:
Maximilian Grundke
2017-06-08 16:46:15 +02:00
parent 9a71405c49
commit f0fb52d92a
5 changed files with 38 additions and 12 deletions

View File

@ -1,5 +1,5 @@
class RequestForCommentsController < ApplicationController
before_action :set_request_for_comment, only: [:show, :edit, :update, :destroy, :mark_as_solved]
before_action :set_request_for_comment, only: [:show, :edit, :update, :destroy, :mark_as_solved, :set_thank_you_note]
skip_after_action :verify_authorized
@ -34,6 +34,18 @@ class RequestForCommentsController < ApplicationController
end
end
def set_thank_you_note
authorize!
@request_for_comment.thank_you_note = params[:note]
respond_to do |format|
if @request_for_comment.save
format.json { render :show, status: :ok, location: @request_for_comment }
else
format.json { render json: @request_for_comment.errors, status: :unprocessable_entity }
end
end
end
def submit
end