Big Old Rails Template
This template assists in spinning up new Rails applications quickly using Rails 2.3. To use it, just specify the -m switch when creating a Rails application:
rails new_app_name -m lark_template.rb
This template has not been tested with the new architecture of the Rails 3.0 master branch. That is, it can create Rails 3 applications, but it may not run under Rails 3.
Two things you should take note of:
- It’s a pretty heavyweight template, sticking a lot of stuff into the new application. This suits me, because I have a lot of things I use in just about every application, but it may not suit you.
- Rails templates are not one-size-fits-all; you should understand what the template does before blindly using it. Unlike most other Rails templates though, it allows you to configure the application that it builds.
You can configure this template to control the application that it generates. See
config.yml to set persistent configuration information. The template will use a configuration file located at
~/.big_old_rails_template/config.yml if it finds one; otherwise, it will use the copy embedded in the template directory. If you don’t have a
config.yml, or it doesn’t have an option that the template is looking for, you’ll be prompted at runtime for some of the information, and reasonably sensible defaults will be used for the rest. You should review config.yml before you first run the template.
Here’s a list of what this template sets up:
- Uses the edge of the 2-3-stable branch in the Rails git repository. You can change the branch in config.yml, so you can use, for example, 2-2-stable or (if you’re feeling brave) master.
- Uses formtastic for forms.
- Optionally uses Bluetrip CSS for design.
- Choice of prototype or jquery
- git repo
- master, staging, and development branches (you can adjust this in config.yml)
- Rails and plugins installed with Piston by default – you can change this to use Braid, git submodules, or just straight code in config.yml.
- Vendored Rails. You can also choose to depend on gem rails, or to symlink to a local copy of Rails, instead of vendoring it to the project.
- Authlogic for user authentication, including password resets,
- World’s simplest authorization system: manage multiple string roles on users with
- Date formats:
:live_validations => trueto
form_fordeclarations to hook this up.
- Paperclip for attachment management
- /pages/css_test will show most CSS styles in action
- Searchlogic for magic named scopes and search forms. Includes
attribute_blank, etc., etc.
- Stringex for extra string functionality –
- US State application helpers
- will-paginate for pagination
- Hooked up for PostgreSQL, MySQL, or sqlite depending on your configuration options
- admin-data plugin for administrative UI. http://localhost:3000/admin_data will get you to the application’s data. On production, only admin can view data, no one can edit (modify config/initializers/admin_data.rb to adjust this)
- db-populate for seed data
- fast_remote_cache strategy for deployment
- rubiadhstrano for deployment recipes; automatically uses multiple targets, so: cap production deploy for deployment to production
- superdeploy for additional Capistrano tasks. cap -T for full list.
- Exceptional or Hoptoad for error tracking. Go to /pages/kaboom to test after finishing setup.
- New Relic or Scout for performance tracking, depending on your configuration options.
- Shoulda and Test::Unit for testing
- Mocha for mocking
- Object Daddy for factories
- Generated code is already covered by tests
- parallel-specs for faster testing. rake spec:parallel:prepare2 to set up two test databases. rake test:parallel2 to distribute tests across two cores
- rack-bug for request/response/perf analysis. http://localhost:3000/rack_bug/bookmarklet.html to add bookmarklet to browser.
- shmacros for additional Shoulda macros:
- More extra shoulda macros:
- metric-fu for static code analysis. rake metrics:all, configure in Rakefile
- inaction-mailer is installed for development environment, so mails sent during dev will end up as files in /tmp/sent_mails.
rake mail:clearwill clean out this directory.
- Code to encourage IE6 users to get a real browser is included on the home page by default. You can adjust this in the configuration.
I welcome suggestions and contributions. See the project’s wiki to contribute to the wishlist, or fork the project on GitHub and submit a pull request when you’ve got something to add.
- Eric Davis (bug fixes, better architecture for config)
- Paco Guzman (bug fixes)
- Jeraimee (MySQL translation of database.yml)
- Maran Hidskes (fix to allow running with no config)
- Wynst (bug fixes)
- Rob Zolkos (typo fix)