Rails - Understanding application.js and application.css

前端 未结 4 1096
囚心锁ツ
囚心锁ツ 2021-02-14 01:44

New to rails. Just trying to understand these two files in the \\assests directory.

For example, the application.js file has lines such as:

//= require j         


        
4条回答
  •  春和景丽
    2021-02-14 02:24

    To understand it, you have to look at Sprockets, which is used for compiling and serving web assets.

    You can find these files using gem which. Here is an example with bootstrap-sass:

    ~ gem which bootstrap-sass
    /Users/andr/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bootstrap-sass-2.3.0.1/lib/bootstrap-sass.rb
    

    The explanation of @import 'bootstrap': https://github.com/thomas-mcdonald/bootstrap-sass#css and there is an open issue with comments.

提交回复
热议问题