controller show action
def show
@batch = Batch.find(params[:id])
@batch_id = @batch.id
authorize @batch
end
pundit policy
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
I am getting nil when I puts @batch_id
, how can I get that value in policy action