Twitter::Bootstrapped

Get quickly up and running with Twitter Bootstrap in Rails 3. The gem provides version 2 of the Twitter Bootstrap assets as well as some generators.

Installation

Add this line to your application's Gemfile:

gem 'twitter-bootstrapped'

And then execute:

$ bundle
$ rails generate bootstrap:install

Generators

Layout

To install a layout run

$ rails generate bootstrap:layout [name] [fixed or fluid]

This will create the following files

  • app/views/layouts/application.html.slim
  • app/views/layouts/_flash.html.slim
  • app/views/application/_header.html.slim
  • app/views/application/_footer.html.slim

Pass --help to get more information.

Scaffolds (slim)

The gem comes with a slim scaffold generator. Make sure you have configured template_engine to :slim

Instead of using the slim-rails, just use the slim gem and add this to config/initializers/generators.rb:

Rails.application.config.generators do |g|
  g.template_engine = :slim
end

Then you can run the standard rails scaffold generator:

$ rails generate scaffold Product name:string price:integer

ps - the scaffold templates support SimpleForm ;)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request