简体   繁体   中英

How to enable less in Rails 3.2 using Twitter Bootstrap

I decided to use the twitter-bootstrap-rails gem and then ran these generators:

rails g bootstrap:install 
rails g bootstrap:layout application fluid
rails g bootstrap:themed products

and it installed some files as expected, but when I access to my application it has the links and button with the Twitter style but the nav the content and the sidebar are all not fixed.

It seems that bootstrap.css.less is not being open I've tried installing the following:

  • less
  • less-rails
  • less-rails-bootstrap

but nothing happens. Is there any extra configuration that I have to do?

I'm using Less in a Rails 3.2 application with Edge twitter-bootstrap-rails in my Gemfile:

gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git'

You might be able to get this to work putting it under the 'assets' group, but for my needs, I had to include it for the whole application.

After that, follow the instructions at https://github.com/seyhunak/twitter-bootstrap-rails and see how you go.

My installation seems to differ from yours, as my bootstrap less file is app/assets/stylesheets/bootstrap_and_overrides.css.less

If this is true for you, you should rename any include/imports from 'bootstrap' to 'bootstrap_and_overrides'

The only other thing I can think of, is that Twitter Bootstrap requires JQuery 1.7.

Hope this helps,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM