Assets pipeline doesn't work in 'application.scss' in my Rails 4.2 app

后端 未结 3 1516
甜味超标
甜味超标 2021-01-26 03:42

I\'m new in Rails and apologize if that is a stupid question. But i cannot resolve my problem: I added Bootstrap to my new app but it still doesn\'t use any new styles.

3条回答
  •  清酒与你
    2021-01-26 04:12

    there is an easier way, I will describe the sequence: after adding gem 'bootstrap-sass' doing bundle install, restart server than add in config/application.rb next string:

    config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
    

    for your images, than create custom.css.scss in app/assets/stylesheets and add there @import "bootstrap";, in your custom.css.scss you can write your own styles

提交回复
热议问题