Files
old-holivud2/app/controllers/casting_call_interviews_controller.rb
2020-07-16 17:38:21 +02:00

29 lines
707 B
Ruby

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