README.md in petergate-0.1.8 vs README.md in petergate-0.1.9
- old
+ new
@@ -4,48 +4,48 @@
## Installation
Add this line to your application's Gemfile:
- $ gem 'petergate'
+ gem 'petergate'
And then execute:
- $ bundle
+ bundle
Or install it yourself as:
- $ gem install petergate
+ gem install petergate
Make sure you already have a User model setup. Works great with [devise](https://github.com/plataformatec/devise).
Run generator to install it.
- $ rails g petergate:install
- $ rake db:migrate
+ rails g petergate:install
+ rake db:migrate
This will add:
```ruby
petergate(roles: [:admin])
```
-to your gem file.
+to your User model.
## Usage
Setup permissions in your controllers the same as you would for a before filter like so:
```ruby
access all: [:show, :index], user: AllRest
```
-Inside your views you can use logged?(:admin, :customer) to show or hide content.
+Inside your views you can use logged_in?(:admin, :customer) to show or hide content.
```erb
-<%= link_to "destroy", destroy_listing_path(listing) if logged_in?(:admin) %>
+<%= link_to "destroy", destroy_listing_path(listing) if logged_in?(:admin, :customer) %>
```
## Contributing
-1. Fork it ( https://github.com/[my-github-username]/petergate/fork )
+1. Fork it ( https://github.com/isaacsloan/petergate/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request