Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Cream demo app for Rails 3 with ActiveRecord
Ruby JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib/tasks
public
script
test
vendor/plugins
.gitignore
Gemfile
Gemfile.lock
README.textile
Rakefile
config.ru

README.textile

Cream Rails 3 demo app – Active Record

This is app serves to demonstrate how to configure a Rails 3 app for use with Cream and Active Record

Create Rails 3 app without Active Record

$ rails new cream_app —skip-activerecord
$ cd cream_app

Install Cream

Insert in Gemfile

  gem 'cream'

Install using bundler

$ bundle install

A set of gems related to Cream are installed…


Using cancan (1.4.1)
Using cancan-permits (0.3.6)
Using cancan-rest-links (0.2.0)
Using devise (1.1.5)
Using devise-links (0.2.1)
Using cream (0.7.8)
  $ rails g

Now we have a lot of interesting generators at our disposal related to Cream


Cancan:
cancan:config
cancan:license
cancan:licenses
cancan:permit
cancan:permits
cancan:restlinks Cream: cream:app cream:full_config Devise: devise devise:config devise:install devise:links devise:users devise:views Permits: permits:config Roles: roles:config

Check the run options for the main generator

Check out the options available when running the cream:full_config generator

  $ rails generate cream:full_config -h

The —orm and —strategy options are essential.

Do a Full Cream configuration of the app

The following will set up the app using:

  • a simple role_string role strategy (role attribute of type String on the User model)
  • mongoid as the ORM
  • create a devise Admin user that inherits from User
  $ rails g cream:full_config --orm active_record --strategy role_string --admin-user

Note: You can leave out the orm option as Active Record is the default orm.

Run migrations

  $ rake db:migrate

Note you can also supply the -m option to the ‘cream:full_config’ generator in order to autorun migrations as the final step ;)

Start the server

Ready to rock!

  $ rails server

From here on, read the README of the individual subproject that Cream consists of, such as devise, cancan, cancan-permits and so on to enhance this application.

Note: Currently there is even no devise routes in this app!

Something went wrong with that request. Please try again.