Datsik
Datsik

Reputation: 14824

How do I use Twitter Bootstrap with Ruby on Rails 3.2.12?

I'm switching from PHP to Ruby on Rails and I'm loving it, the only thing is I'm so used to Twitter Bootstrap for most of my designs and now I feel crippled without it, I followed some tutorials like adding bootstrap-sass and what not to my Gemfile, but I still appear to be missing important things like input-block-level I'm just curious if there is an updated version or a easier tutorial to follow? Thanks.

Upvotes: 1

Views: 23548

Answers (4)

sameera207
sameera207

Reputation: 16629

AFAIK, the easiest and most rails way to integrate the twitter bootstrap to rails is via

twitter-bootstrap-rails gem, they have a pretty good documentation too.

check these screen casts, and this (premium) to get an idea.

and welcome to Rails :)

Upvotes: 9

RahulOnRails
RahulOnRails

Reputation: 6542

Just download the bootstrap ( CSS, JS ) file and make the updation in that file at regular interval from his official site : Bootstrap

For Bootstrap Tutorials : Click Here

Or you can refer the sample code for reference, because sometimes we dnt get the way to implement such functionality like tooltip.

Upvotes: 0

Benjamin Bouchet
Benjamin Bouchet

Reputation: 13181

Same as you, I'm coming from PHP and love RoR ;)

With bootstrap you need to import it in your manifest. Read a bit about the assets pipeline in RoR guide.

To import bootstrap, create a file in your app/assets/stylesheets directory, with the name you want, but with the extension .css.scss, and place in it the following line:

@import "bootstrap";

Also if you need to use the javascript helpers from bootstrap, you need to add the following line in your app/assets/javascript/application.js file:

//= require bootstrap

Upvotes: 0

Mab879
Mab879

Reputation: 608

To to the input-block-level in ERB do something like this

"input-block-level" => "hello_world"

Upvotes: 0

Related Questions