Where do you put CSS files in a rails app directory?

前端 未结 6 1111
甜味超标
甜味超标 2021-01-17 08:21

Where should i create a folder to house my CSS files within my rails app directory??

6条回答
  •  野的像风
    2021-01-17 08:37

    For Rails 3.1+ apps, you should use the asset pipeline. Place stylesheets in app/assets/stylesheets/ if they are specific to your application. You can also put them at vendor/assets/stylesheets/ if they are external (say if they are stylesheets for a javascript plugin.)

    After that, you will include stylesheets using the app/assets/stylesheets/application.css if it is included in your layout file (see other answers for how to do this.)

提交回复
热议问题