Asset Pipeline: excluding an admin.css file

后端 未结 4 1602
北海茫月
北海茫月 2021-02-05 03:55

I upgraded a Rails 3.0 app to Rails 3.1 which involved putting this

/*
*= require_self
*= require_tree .
*/

in the application.css file. Howeve

4条回答
  •  鱼传尺愫
    2021-02-05 04:21

    You can use the stub sprockets' directive in your manifest like this :

    /*
    *= require_self
    *= require_tree .
    *= stub admin
    */
    

    This will exclude admin.css and also ALL css required in it !! So, if your admin.css's manifest seems like this :

    /*
    *= require bootstrap
    *= require_self
    */
    

    the bootstrap.css will also be excludes and no require could fixe this ! Take care of this ;)

提交回复
热议问题