Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Application templates for Rails 3.1 starter apps you can deploy in minutes.
Branch: rails-3-0-7
Pull request Compare This branch is even with RailsApps:rails-3-0-7.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
files
.gitignore
README
README.textile
rails3-devise-rspec-cucumber-template.rb
rails3-mongoid-devise-template.rb
rails3-mongoid-omniauth-template.rb
rails3-subdomain-devise-template.rb

README.textile

Rails 3 Application Templates

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

The application generator templates will ask you for various preferences:

  • Would you like to use jQuery instead of Prototype? (for Rails 3.0)
  • Would you like to use jQuery UI? (for Rails 3.0 or 3.1)
  • Would you like to use Haml instead of ERB?
  • Would you like to use RSpec instead of TestUnit?
  • Would you like to use factory_girl for test fixtures with RSpec?
  • Would you like to use Cucumber for your BDD?
  • Would you like to use Mongoid to connect to a MongoDB database?
  • Would you like to use Devise for authentication?
  • Would you like to use OmniAuth for authentication?
  • Would you like to set a robots.txt file to ban spiders?

Applications

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

Tutorials

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

Any issues? Please create an Issue on GitHub.

Follow on Twitter Follow on Twitter Join the Mailing List Join the Mailing List

Follow the project on Twitter: http://twitter.com/rails_apps. Please tweet some praise if you like what you’ve found.

Join the email list (low volume, announcements only) for project updates and tips about Rails resources.

Suggested Use

Any developer can quickly generate a Rails web application using just the rails new command. In practice, experienced Rails developers typically add an assortment of useful additional packages (known as RubyGems, or just “gems”) before beginning development of any web application. A developer often uses the same set of gems to get started and may create a “starter app” that can be copied and reused for any new project. Often a developer will create an “application template” to automate the creation of starter apps.

Rails application templates are Ruby scripts used with the "rails new app_name -m" command to generate a Rails web application.

Application templates commonly integrate popular gems that many Rails developers include in a starter app. It can be a hassle to integrate some of the most commonly used gems, particularly when new versions are released and there are minor “gotchas” that interfere with gems working together. By using these application templates, you’ll have a ready-to-run app without the integration “gotchas”. Each has a detailed tutorial so you’ll see exactly how the application was assembled.

These application templates were created using the Rails Apps Composer gem which provides a convenient way to assemble a reusable application template by selecting various “recipes” for popular Rails development gems.

You can use the application templates from this repository to generate a starter app directly. You can edit the templates to customize the script to generate a customized starter app. Or you can use the Rails Apps Composer gem to assemble a selection of recipes for a customized starter app.

Dependencies

Before generating your application, you will need:

  • The Ruby language (version 1.8.7 or 1.9.2)
  • Rails (version 3.0.5 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.

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

Generating the Application

Use the "rails new app_name -m" command to generate a Rails web application.

You can add the -T -O flags to skip Test::Unit files and Active Record files. For Rails 3.0, you can also add the -J flag to skip Prototype files.

Template for Rails 3 + Devise + RSpec + Cucumber

To build the “rails3-devise-rspec-cucumber” example application, run the command:

$ rails new APP_NAME -m https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb -T

Use the -T flag to skip Test::Unit files. Add the -J flag to skip Prototype files for Rails 3.0 (not needed for Rails 3.1).

Template for Rails 3 + Mongoid + Devise

To build the “rails3-mongoid-devise” example application, run the command:

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

Use the -T -O flags to skip Test::Unit files and Active Record files. Add the -J flag to skip Prototype files for Rails 3.0 (not needed for Rails 3.1).

Template for Rails 3 + Mongoid + OmniAuth

To build the “rails3-mongoid-omniauth” example application, run the command:

$ rails new APP_NAME -m https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-mongoid-omniauth-template.rb -T -O

Use the -T -O flags to skip Test::Unit files and Active Record files. Add the -J flag to skip Prototype files for Rails 3.0 (not needed for Rails 3.1).

Template for Rails 3 + Subdomains + Devise

To build the “rails3-subdomain-devise” example application, run the command:

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

Use the -T -O flags to skip Test::Unit files and Active Record files. Add the -J flag to skip Prototype files for Rails 3.0 (not needed for Rails 3.1).

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 Recipes

For your reference, here’s an annotated list of available recipes for the Rails Apps Composer gem. For an up-to-date list, browse the repository recipes directory.

Documentation and Support

This is the only documentation.

Customizing the Template

If you wish to “change the recipe” to generate the app with your own customized options, you can copy and edit the template file. However, it is better to use the Rails Apps Composer gem to create a new application template. You’ll find newer versions of the recipes that make up the application template. You may find issues have been identified and (perhaps) fixed. And it will be easier to maintain your application template if you work from the Rails Apps Composer gem.

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. Here’s an annotated list of other Rails application template projects and Rails examples, tutorials, and starter apps.

Contributing

If you make improvements to this application, please share with others.

Send the author a message, create an issue, or fork the project and submit 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 the project on Twitter:
http://twitter.com/rails_apps
and tweet some praise. I’d love to know you were helped out by what I’ve put together.

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.

Something went wrong with that request. Please try again.