Commit 5d69caf7 authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou
Browse files

fix index authorization

parent 42eaafd6
......@@ -3,8 +3,7 @@ class BillingExpensesController < ApplicationController
before_action :set_volunteer
def index
billing_expense = BillingExpense.new(volunteer: @volunteer)
authorize billing_expense
authorize BillingExpense
@billing_expenses = BillingExpense.where(volunteer: @volunteer)
end
......
......@@ -2,24 +2,20 @@
.col-xs-12
h1= @volunteer.contact.full_name
.row
- if policy(Volunteer).supervisor?
.col-xs-12
= render 'journals/journal_block', journaled_for: @volunteer
.row
- if policy(Volunteer).seeking_clients? & @volunteer.seeking_clients?
.col-xs-12
= button_link t_title(:new, Assignment), new_assignment_path(volunteer_id: @volunteer)
.row
- if @volunteer.assignments.any?
.col-xs-12.col-md-3
= button_link t_title(:new, Hour), new_volunteer_hour_url(@volunteer)
.col-xs-12.col-md-3
= button_link t_title(:index, Hour), volunteer_hours_path(@volunteer)
.col-xs-12.col-md-3
= button_link t_title(:new, BillingExpense), new_volunteer_billing_expense_path(@volunteer)
.col-xs-12.col-md-3
= button_link t_title(:index, BillingExpense), volunteer_billing_expenses_path(@volunteer)
nav.navbar.section-navigation
ul.list-inline
- if policy(Volunteer).supervisor?
li = render 'journals/journal_block', journaled_for: @volunteer
ul.list-inline
- if @volunteer.seeking_clients?
li = button_link t_title(:new, Assignment), new_assignment_path(volunteer_id: @volunteer)
- if @volunteer.assignments.any?
li = button_link t_title(:new, BillingExpense), new_volunteer_billing_expense_path(@volunteer)
li = button_link t_title(:index, BillingExpense), volunteer_billing_expenses_path(@volunteer)
ul.list-inline
- if @volunteer.assignments.any?
li = button_link t_title(:new, Hour), new_volunteer_hour_url(@volunteer)
li = button_link t_title(:index, Hour), volunteer_hours_path(@volunteer)
- if policy(Volunteer).checklist?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment