Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created September 18, 2013 21:45
Show Gist options
  • Save angelsystem/6616197 to your computer and use it in GitHub Desktop.
Save angelsystem/6616197 to your computer and use it in GitHub Desktop.
before_filter :load_resource_unit
before_filter :load_resource_budget, only: [:show, :edit, :update, :action_exception]
authorize_resource :unit
authorize_resource :budget, except: [:new, :create, :asign_clients, :save_clients]
authorize_resource :budget, through: :unit, only: [:new, :create, :destroy]
def load_resource_budget
@budget = Budget.find params[:id]
end
def load_resource_unit
@unit = Unit.find params[:unit_id]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment