Alex Rivera | Logout

twitter-bootstrap-rails gem workflow

Asked 2012-02-02T19:47:55.223
11

How do I use the twitter-bootstrap-rails gem in my Rails 3.2.1 app? What is the workflow?

After I do:

rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] [options]

what do I do next? Do I just copy and paste the generated code into my view? Do I do this for every view? If so, how is doing

rails g bootstrap:themed [RESOURCE_NAME] [LAYOUT] [options]

any different?

Do you guys even use the rails generators?

Thanks

Edit
Report

1 Answer

46

I'm the author of twitter-bootstrap-rails gem. I'll give you a quick walktrough to how to install and use twitter-bootstrap-rails.

Ruby stack; (Ruby 1.9.3, Rails 3.1 or Rails 3.2 is required. Use RVM to get started)

After bundling gem to Gemfile by;

gem 'twitter-bootstrap-rails'

bundle install

Run install generator

rails g bootstrap:install

(it will includes Twitter Bootstrap to your app's asset pipeline)

Run layout generator

rails g bootstrap:layout application fixed

(it will generates layout for you, by default application.html.erb and fixed layout will generates)

Run themed generator (optional);

rails g scaffold post title:string description:text

(this step uses Rails generators to create CRUD stuff for you)

rake db:migrate

(migrating to database)

rails g bootstrap:themed posts

(Twitter Bootstrap compatible styling for your 'posts' views and form)

Also there is detailed documentation to install, usage and generators, coffeescript etc. https://github.com/seyhunak/twitter-bootstrap-rails.

answered 2012-02-03T08:05:35.273

Your Answer