Sha256: 51223d6a03f8a1442e2189825ed183e678549b1b0dbb02c4e9a91d2e29c182a9

Contents?: true

Size: 983 Bytes

Versions: 1

Compression:

Stored size: 983 Bytes

Contents

# Fume::Cancan

[![Build Status](https://travis-ci.org/sunteya/fume-cancan.svg?branch=master)](https://travis-ci.org/sunteya/fume-cancan)
[![Coverage Status](https://coveralls.io/repos/sunteya/fume-cancan/badge.png?branch=master)](https://coveralls.io/r/sunteya/fume-cancan?branch=master)

helper methods for CanCan

## Installation

Add this line to your application's Gemfile:

    gem 'fume-cancan'

## Usage

### authorize_object

~~~~ruby
# Ability:
can :manage, :admin

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

### with_scope

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

## Contributing

1. Fork it
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 new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fume-cancan-0.1.0 README.md