Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
master
Commit Description:
master
class TestcasesController < ApplicationController
before_action :set_testcase , only : [ :download_input , :download_sol ]
before_action :testcase_authorization
def download_input
send_data @testcase . input , type : 'text/plain' , filename : " #{ @testcase . problem . name } . #{ @testcase . num } .in"
end
def download_sol
send_data @testcase . sol , type : 'text/plain' , filename : " #{ @testcase . problem . name } . #{ @testcase . num } .sol"
end
def show_problem
@problem = Problem . includes ( :testcases ) . find ( params [ :problem_id ] )
unless @current_user . admin? or @problem . view_testcase
flash [ :error ] = 'You cannot view the testcase of this problem'
redirect_to :controller => 'main' , :action => 'list'
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_testcase
@testcase = Testcase . find ( params [ :id ] )
end
# Only allow a trusted parameter "white list" through.
def testcase_params
params [ :testcase ]
end
end
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings