Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails Boilerplate : Collections of gems & code we tend to use on about every Rails project.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
lib
public
script
spec
vendor
.gitignore
.gitmodules
.rspec
Capfile
Gemfile
Gemfile.lock
Guardfile
README.md
Rakefile
config.ru
dot.vimrc

README.md

Rails Boilerplate

Collections of gems / code we tend to use on about every project. Feel free to take whatever you need.

Work in progress. Not much to see for now.

I'm in a hurry, get me started

INCOMPLETE (Yup, Backstreet Boys song)

Change the __YOUR_PROJECT_NAME__ in the third line

git clone git://github.com/hooktstudios/rails-bp.git
cd rails-bp
perl -e "s/RailsBP/__YOUR_PROJECT_NAME__/g;" -pi $(find . -name "*.rb" -o -name "Rakefile" -o -name "*.erb" -o -name "*.ru")
git submodule update --init
cp config/capistrano-recipes/config-samples/unicorn.rb config/unicorn.rb
curl http://twitter.github.com/bootstrap/assets/css/bootstrap.css > vendor/assets/stylesheets/bootstrap.css

Edit config/deploy.rb, config/database.yml and config/unicorn.rb

Intended usage

This is intended to be used as a collection of tools to start projects quickly. This is by no mean a perfect solution and it definitey has to be customized.

Do not use this if you don't understand what's going on under the hood.

What's in included

  • Tests
  • Assets
  • Forms
    • SimpleForm
    • SimpleForm wrapper for Twitter Bootstrap (config/initializers/simple_form)
  • Production & deployment
    • Capistrano
    • Unicorn
  • Dev tools
  • Admin goodies
    • Admin base controller (app/controllers/admin/base_controller.rb).
    • Inherited Resources for DRY controller
    • Admin layout (app/layouts/admin.html.erb).
    • Admin base helper (app/helpers/admin/base_helper.rb). Includes :
      • admin_form_for : SimpleForm wrapper that defaults to Twitter's bootstrap.
      • admin_paginate : Kaminari wrapper with the Twitter's bootstrap theme.
    • Admin stylesheet that requires Twitter's bootstrap.
  • Misc

Admin

Let's stop re-inventing the wheel for admin backends. The boilerplate includes an helper to create admin forms which defaults to the Twitter Bootstrap SimpleForm wraper, and an admin base controller.

Don't want no admin? Remove ALL THE FILES:

rm -rf app/helpers/admin app/controllers/admin app/views/layouts/admin.html.erb app/assets/stylesheets/admin.css

Credits

Credits goes to all the gems contributors. Bootstrap integration is stolen from SimpleFormBootstrap

TODOs

  • Move most of this stuff to generators
  • Create a CLI tool that helps setuping the boilerplate instead of copying commands
  • Write generators for more Twitter Bootstrap admin goodness
Something went wrong with that request. Please try again.