Application templates for a Rails 3 starter app you can deploy in minutes.
Pull request Compare This branch is 29 commits behind fortuity:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README
README.textile
rails3-mongoid-devise-template.rb
rails3-subdomain-devise-template.rb

README.textile

Rails3-Application-Templates

These application generator templates give you a Rails 3 skeleton or starter app you can deploy in minutes.

The templates combine Mongoid with Devise. Mongoid is a datastore that gives you quick development without schemas or migrations. Devise gives you ready-made authentication and user management.

Applications

The templates can be used to build the following complete applications:

Tutorials

There are detailed tutorials to show how each application is built:

Template Recipes

These application generator templates are assembled from “recipes”.

You can see a collection of useful template recipes:

Use the recipes to customize your own application generator templates.

More Information

Are the templates useful to you? Follow me on Twitter:
http://twitter.com/yaxdotcom
and tweet some praise. I’d love to know you were helped out by what I’ve put together.

Any issues? Please create an Issue on GitHub.

What You’ll Get

Both templates provide:

  • Mongoid for the MongoDB datastore
  • Devise for authentication and user management
  • Haml or ERB for a templating engine
  • jQuery or Prototype for a Javascript framework
  • Remove unneeded files (such as “public/index.html”)
  • Prevent logging of passwords (in “config/application.rb”)
  • Application layout (with flash notices/alerts)
  • Home controller and view
  • User model, controller and view
  • Database seed file with default user
  • Heroku for deployment and hosting (optional)
  • Git for source control with “.gitignore”, init and commit

The rails3-subdomain-devise-template adds:

  • subdomains

Gems

The templates require these gems:

These gems are optional:

The rails3-subdomain-devise-template requires this gem:

Dependencies

Before generating your application, you will need:

  • The Ruby language (version 1.8.7 or 1.9.2)
  • Rails (version 3.0.4 or newer)

You MUST be using Rails 3.0.4 or newer. Generating a Rails application from an “HTTPS” URL does not work in Rails 3.0.3 and earlier versions.

I recommend installing rvm, the Ruby Version Manager, to manage multiple versions of Rails.

If you are using rvm, you can see a list of the Ruby versions currently installed:
$ rvm list

Check that appropriate versions of Ruby and Rails are installed in your development environment:
$ ruby -v
$ rails -v

You will also need:

  • A working installation of MongoDB (version 1.6.0 or newer)

If you don’t have MongoDB installed on your computer, you’ll need to install it and set it up to be always running on your computer (run at launch). On Mac OS X, the easiest way to install MongoDB is to install Homebrew and then run the following:

brew install mongo
sudo mkdir -p /data/db
sudo chmod -Rv 777 /data/

Generating the Application

Generate a new Rails application with the command:

$ rails new app_name -m https://github.com/fortuity/rails3-application-templates/raw/master/rails3-mongoid-devise-template.rb -T -O -J

or

$ rails new app_name -m https://github.com/fortuity/rails3-application-templates/raw/master/rails3-subdomain-devise-template.rb -T -O -J

Use the -T -O -J flags to skip Test::Unit files, Active Record files, and Prototype files.

You MUST be using Rails 3.0.4 or newer. Generating a Rails application from an “HTTPS” URL does not work in Rails 3.0.3 and earlier versions.

This creates a new Rails app (with the app_name you provide) on your computer.

The application generator template offers you the following options:

  • set up your view files using the Haml templating language
  • use jQuery instead of Prototype
  • install the heroku gem for deployment to Heroku

If you wish to “change the recipe” to generate the app with your own customized options, you can copy and edit the template file.

Documentation and Support

This is the only documentation.

Writing Recipes

To understand the code in these templates, take a look at Thor::Actions. Your recipes can use any methods provided by Thor::Actions or Rails::Generators::Actions.

About Rails Application Templates

Cooking Up A Custom Rails 3 Template (11 Oct 2010) by Andrea Singh
Rails Application Templates (16 Sept 2010) by Collin Schaafsma
Application templates in Rails 3 (18 Sept 2009) by Ben Scofield
Railscasts: App Templates in Rails 2.3 (9 Feb 2009) by Ryan Bates
Rails templates (4 Dec 2008) by Pratik Naik

Issues

Any issues? Please create an Issue on GitHub.

Similar Projects

There are many similar projects. To my knowledge, these are the only application templates that combine Mongoid with Devise.

Rails template-generating applications

Visit these websites to select components and generate an application template.

Devise or OmniAuth, Mongoid or MongoMapper or ActiveRecord, RSpec or TestUnit, Cucumber or Steak, jQuery or Prototype or MooTools, ERB or Haml or Slim, Sass or Less CSS.

In development as of February 2011.

Rails application-generating gems

Install this gem and then choose components and generate an application.

Mongoid or ActiveRecord, RSpec or TestUnit, FactoryGirl, Cucumber, jQuery or Prototype, ERB or Haml or Slim, Sass, Compass.

Rails application templates

Use these scripts with the "rails new app_name -m" command to generate an application.

These projects were updated in 2011 and use Devise:

Devise, RSpec, Factory Girl, jQuery, Haml, Sass, Compass, Git, rvm, HTML5 Boilerplate, plus a layout. Uses subtemplates for easy customizing.

Devise (with Cucumber steps), Cucumber, RSpec, Factory Girl, Haml, Compass, jQuery, Git, Formtastic, a layout, and much more. Uses subtemplates for easy customizing.

Devise or Authlogic or OmniAuth, Cucumber, Capybara, RSpec, Factory Girl, Shoulda, jQuery, Haml, Compass, 960 grid or Blueprint, Capistrano or Heroku or Inploy, Git, plus a layout. Uses subtemplates for easy customizing.

PostgreSQL, Devise, Cucumber with Selenium and Capybara, RSpec with Machinist and Faker, JQuery, Simple Form, Haml, SASS, Git, rvm, Google analytics (optional), Hoptoad for issue tracking (optional), TellThemWhen for downtime notifications (optional). With a description of the recipe in the README.

These projects were updated in 2010 and use Devise:

Devise, RSpec, Cucumber with Capybara, Factory Girl, jQuery, Simple Form, Git, rvm. Uses subtemplates for easy customizing.

Devise, Cucumber, Shoulda with Factory Girl and Mocha, Haml, Sass, Formtastic, jQuery, Git, rvm.

This project was updated in 2010 and uses Mongoid:

Mongoid or ActiveRecord, RSpec, FactoryGirl, Cucumber (with Mongoid steps), jQuery, Haml, Sass, Compass. Uses subtemplates for easy customizing.

These projects were updated in 2011 and do not use Devise or Mongoid:

Cucumber, RSpec, jQuery, Haml or Jammit, Capistrano, Git, rvm, plus a layout. Uses subtemplates for easy customizing.

Cucumber, RSpec, Factory Girl or Fabrication, Haml, jQuery, Git, rvm.

Haml, Sass, Git, plus a layout.

These Rails 2.3 projects were once popular but haven’t been updated since 2009 or 2010:

For a ranking by popularity, see:
The Ruby Toolbox: Rails App Templates

Contributing

If you make improvements to these templates, please share with others.

  • Fork the project on GitHub.
  • Make your feature addition or bug fix.
  • Commit with Git.
  • Send the author a pull request.

If you add functionality to this application, create an alternative implementation, or build an application that is similar, please contact me and I’ll add a note to the README so that others can find your work.

Credits

Daniel Kehoe (http://danielkehoe.com/) created these templates.

Are the templates useful to you? Follow me on Twitter:
http://twitter.com/yaxdotcom
and tweet some praise. I’d love to know you were helped out by what I’ve put together.

Any issues? Please create an Issue on GitHub.

License

Public Domain Dedication

This work is a compilation and derivation from other previously released works. With the exception of various included works, which may be restricted by other licenses, the author or authors of this code dedicate any and all copyright interest in this code to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this code under copyright law.