README.md in petergate-0.1.7 vs README.md in petergate-0.1.8

- old
+ new

@@ -4,13 +4,11 @@ ## Installation Add this line to your application's Gemfile: -```ruby -gem 'petergate' -``` + $ gem 'petergate' And then execute: $ bundle @@ -20,13 +18,30 @@ 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 +This will add: +```ruby +petergate(roles: [:admin]) +``` +to your gem file. + ## Usage -TODO: Write usage instructions here +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. + +```erb +<%= link_to "destroy", destroy_listing_path(listing) if logged_in?(:admin) %> +``` ## Contributing 1. Fork it ( https://github.com/[my-github-username]/petergate/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`)