0

How am I supposed to use bootstap with rails 3.0 rather than >= 3.1 ? is there any plugin which supports rails 3.0 ?

1
  • 3
    Why not just include the files yourself? Commented Mar 14, 2012 at 21:46

2 Answers 2

3

I think all of the bootstrap gems require Rails 3.1 or greater. I recently had bootstrap on a 3.0.10 Rails app using the Less.js file that you download from their site: http://lesscss.org/. This is the simplest most basic way to use Twitter-Bootstrap; the file compiles all of your "my_file.less" files into css on the client side.

However, if you want to modify the variables (which is the real power of using this framework) than you need to compile it. You can take a look at this Less compiler: http://wearekiss.com/simpless. I've never tried that, but I hear good things about it and it works on Mac, Linux, or PC.

Probably the easiest thing to do - if you want to compile the code on server side - would be to upgrade your project to Rails 3.1.1 and just use one of the Twitter Bootstrap gems. This is actually exactly what I ended up doing. I was able to update my app to 3.1.1 and I used the Boostrap-Sass gem (just because I slightly prefer Sass).

If you decide to upgrade, follow this RailsCast: http://railscasts.com/episodes/282-upgrading-to-rails-3-1

It helped me a lot.

Ryan Bates also offers a video on how to incorporate Twitter Bootstrap into a Rails app: http://railscasts.com/episodes/328-twitter-bootstrap-basics.

Here's a link to the Sass version of Bootstrap that I am currently using: https://github.com/thomas-mcdonald/bootstrap-sass

Sign up to request clarification or add additional context in comments.

2 Comments

didn't u face any problems when you upgraded from 3.0.10 to 3.1 ?
I had to make the changes that Ryan suggested in his video, and that was about it. The greatest amount of change involves configuring the Asset Pipeline and sorting your content out into the asset folder. If you are hesitant about trying it, you should make a backup copy of your project first. If you are using git version control, you can just create a branch and if you don't want to keep it, than don't commit your changes and delete the branch.
0

Many solutions : you can upgrade to rails 3.1+, might be the better (not the easier, depending on you app) way. You can include the static files yourself if you don't intend to change anything that is handled at the less level. You can do it even if you intend to, but you'll have to recompile the files yourself (or find a way to automate it). Finally, there might be a gem out there that is compatible with rails pre-asset-pipeline, or an old version of a gem. You'll have to look for yourself if you absolutely want a gem.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.