Skip to content

Commit

Permalink
update usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sunteya committed Sep 13, 2016
1 parent 237c0de commit d37834a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ Add this line to your application's Gemfile:

## Usage

Ability:
### authorize_object

can :manage, :admin
# Ability:
can :manage, :admin

Controller:
# Controller:
class Admin::BaseController < ApplicationController
authorize_object :admin
end

class Admin::BaseController < ApplicationController
authorize_object :admin
end
### with_scope

# Controller:
class Topics < ApplicationController
load_and_authorize_resource with_scope: -> (base) { base.where(online: true) }
end

## Contributing

Expand Down

0 comments on commit d37834a

Please sign in to comment.