Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dnagir committed Jan 7, 2012
1 parent 4a9fdd2 commit 26c33d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ end
If you want to change the context in Rails then just override it on a single controller or globally on the `ApplicationController`: If you want to change the context in Rails then just override it on a single controller or globally on the `ApplicationController`:


```ruby ```ruby
class DefaultAccess class PagesController < ApplicationController
include Allowy::AccessControl def allowy_context
# This will give you methods without the need to go to context object {realy: 'anything, can_be: 'here', event: params}
delegate :current_user, :to => :context end
delegate :current_company, :to => :context
end end
``` ```
Expand All @@ -104,6 +103,8 @@ I recommend creating your own base class to provide common context and maybe som
```ruby ```ruby
class DefaultAccess class DefaultAccess
include Allowy::AccessControl include Allowy::AccessControl
delegate :current_user, :to => :context
delegate :current_company, :to => :context
end end
``` ```
Expand Down

0 comments on commit 26c33d1

Please sign in to comment.