Coder Social home page Coder Social logo

cream-app-mongo_mapper's Introduction

Cream Rails 3 demo application

This app demonstrates how to configure a Rails 3 app with Cream.

Create Rails 3 app without Active Record

  $ rails new cream_app —skip-activerecord  
  $ cd cream_app  

Install Cream

Insert into Gemfile


gem ‘cream’

Also remove gem ‘sqlite3-ruby’

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.6)  
  $ 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
Mongoid:
  mongoid:devise
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 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 mongo_mapper --strategy role_string --admin-user  

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 are no devise routes in this app!?

cream-app-mongo_mapper's People

Contributors

kristianmandrup avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.