Ruby CSS JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
public
test
vendor/assets
.gitignore
.ruby-gemset
.ruby-version
.travis.yml
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
config.ru

README.md

Cancannible Demo with Rails 4.2

Build Status

A Rails 4.2.x application that demonstrates how to use Cancannible gem for role-based access permissions.

This can be used interactively at cancannibledemo4.evendis.com.

See cancannibledemo.evendis.com for the Rails 3.x version of the demo, with source also on GitHub.

How to run the application locally

# clone the app and bundle (NB: assumes you have a working ruby 2 environment)
git clone https://github.com/evendis/cancannible_demo4.git
cd cancannible_demo4
bundle install

# create and verify a db user (the app uses PostgreSQL by defualt)
psql postgres -c "create role cancannible_demo4 with login superuser"
psql postgres -U cancannible_demo4 -c "\c"

# setup the database
rake db:setup

# now you are ready to go..
rails s
open http://localhost:3000

Tests

Tests are written with the Rails standard framework, Minitest, and are found in the ./test folder. See the Rails 3 version of the demo for an example of testing with RSpec.

Only tests that specifically demonstrate cancannible-related behaviour are included, to avoid confusing the issue.

Implementation Notes

The application uses haml for convenience and clarity. There's no dependency however; all this works fine with ERB or other view styles. The customers_controller.rb provides an example of standard ERB views.