diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -1,6 +1,7 @@ class ProblemsController < ApplicationController - before_filter :authenticate, :authorization + before_action :authenticate, :authorization + before_action :testcase_authorization, only: [:show_testcase] in_place_edit_for :problem, :name in_place_edit_for :problem, :full_name @@ -221,6 +222,10 @@ redirect_to :action => 'manage' end + def show_testcase + @problem = Problem.includes(:testcases).find(params[:id]) + end + ################################## protected