Cast me
This commit is contained in:
28
app/controllers/casting_call_interviews_controller.rb
Normal file
28
app/controllers/casting_call_interviews_controller.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
class CastingCallInterviewsController < ApplicationController
|
||||
before_action :set_project
|
||||
before_action :set_casting_call_interview, only: [:show]
|
||||
|
||||
include ProjectLayout
|
||||
|
||||
def index
|
||||
@casting_call_interviews = casting_call_interviews.completed.order_by_recent.paginate(page: params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
@files = @casting_call_interview.files.paginate(page: params[:page])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_project
|
||||
@project = policy_scope(Project).find(params[:project_id])
|
||||
end
|
||||
|
||||
def set_casting_call_interview
|
||||
@casting_call_interview = authorize casting_call_interviews.find(params[:id])
|
||||
end
|
||||
|
||||
def casting_call_interviews
|
||||
authorize policy_scope(CastingCallInterview)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user