控制器显示动作
def show
@batch = Batch.find(params[:id])
@batch_id = @batch.id
authorize @batch
end
权威政策
def show?
puts @batch_id
if !current_user.nil? && (current_user.role?('Student')) || (current_user.role?('Administrator')) || (current_user.role?('SupportSpecialist')) || (current_user.role?('Instructor'))
true
else
false
end
end
当我得到零时,我puts @batch_id
如何才能在政策行动中获得该价值