3

How do I install a custom theme for twitter-bootstrap with the rails asset pipeline?

Should I create a new folder under assets and dump in all of the css, js, image and font files for the theme?

Update: I put all files in my downloaded theme (except the html example files) into a folder in app/assets and added this folder to my asset paths in application.rb:

config.assets.paths << Rails.root.join("app", "assets", "bootstrap_theme")

I added some markup using css classes from the theme but it's not using the theme..

Update: I see that the boostrap theme has the compiled core bootstrap files included inside it. Should I take this to mean it's not intended to be used with Less? Also, should I precompile every asset file individually for production (in application.rb) and in each view include the specific ones needed (and include them after the core bootstrap files)? Then I guess to make any overrides to the theme they'd need to be made directly in the theme files?

Update: I think the problem was that I was requiring the theme css files in my manifest after the bootstrap_and_overrides, assuming the idea of the theme was to change the bootstrap defaults. But requiring some of the theme css before the standard bootstrap_and_defaults works better. It means needing to manually pick and choose which css to load before and after bootstrap.

rigyt
  • 2,219
  • 3
  • 28
  • 40

1 Answers1

3

I never proved the twitter bootstrap in a rails application but I searched before how can I do it.

If you install the gem less-rails-bootstrap or bootstrap-sass, you can follow the instructions to modify the theme here.

I hope it helps.

Pigueiras
  • 18,778
  • 10
  • 64
  • 87
  • Thanks but I want to install a downloaded theme rather than make changes to it. I have been able to make changes to the default theme without a problem – rigyt Jul 15 '12 at 10:55
  • Correct link is http://www.sitepoint.com/how-to-customize-twitter-bootstraps-design-in-a-rails-app/ – Sergiy Seletskyy Sep 22 '13 at 09:57