Clean up controller
This commit is contained in:
@ -22,6 +22,7 @@ class RequestForCommentsController < ApplicationController
|
|||||||
authorize!
|
authorize!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET /my_request_for_comments
|
||||||
def get_my_comment_requests
|
def get_my_comment_requests
|
||||||
@search = RequestForComment
|
@search = RequestForComment
|
||||||
.with_last_activity
|
.with_last_activity
|
||||||
@ -33,6 +34,7 @@ class RequestForCommentsController < ApplicationController
|
|||||||
render 'index'
|
render 'index'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET /my_rfc_activity
|
||||||
def get_rfcs_with_my_comments
|
def get_rfcs_with_my_comments
|
||||||
@search = RequestForComment
|
@search = RequestForComment
|
||||||
.with_last_activity
|
.with_last_activity
|
||||||
@ -45,6 +47,7 @@ class RequestForCommentsController < ApplicationController
|
|||||||
render 'index'
|
render 'index'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET /request_for_comments/1/mark_as_solved
|
||||||
def mark_as_solved
|
def mark_as_solved
|
||||||
authorize!
|
authorize!
|
||||||
@request_for_comment.solved = true
|
@request_for_comment.solved = true
|
||||||
@ -57,6 +60,7 @@ class RequestForCommentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST /request_for_comments/1/set_thank_you_note
|
||||||
def set_thank_you_note
|
def set_thank_you_note
|
||||||
authorize!
|
authorize!
|
||||||
@request_for_comment.thank_you_note = params[:note]
|
@request_for_comment.thank_you_note = params[:note]
|
||||||
@ -73,10 +77,6 @@ class RequestForCommentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def submit
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
# GET /request_for_comments/1
|
# GET /request_for_comments/1
|
||||||
# GET /request_for_comments/1.json
|
# GET /request_for_comments/1.json
|
||||||
def show
|
def show
|
||||||
@ -137,10 +137,6 @@ class RequestForCommentsController < ApplicationController
|
|||||||
authorize!
|
authorize!
|
||||||
end
|
end
|
||||||
|
|
||||||
def comment_params
|
|
||||||
params.permit(:exercise_id, :feedback_text).merge(user_id: current_user.id, user_type: current_user.class.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_request_for_comment
|
def set_request_for_comment
|
||||||
@ -153,4 +149,8 @@ class RequestForCommentsController < ApplicationController
|
|||||||
params.require(:request_for_comment).permit(:exercise_id, :file_id, :question, :requested_at, :solved, :submission_id).merge(user_id: current_user.id, user_type: current_user.class.name)
|
params.require(:request_for_comment).permit(:exercise_id, :file_id, :question, :requested_at, :solved, :submission_id).merge(user_id: current_user.id, user_type: current_user.class.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def comment_params
|
||||||
|
params.permit(:exercise_id, :feedback_text).merge(user_id: current_user.id, user_type: current_user.class.name)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user