Ruby on Rails looks for css in assets instead of public/stylesheets

后端 未结 1 769
刺人心
刺人心 2021-02-04 09:43

I am new to Ruby, using ruby 1.9.2P180 and Rails 3.1.0.rc2

I have \"screen.css\" in my_app_root/public/stylesheets/screen.css and in my application.html.erb



        
相关标签:
1条回答
  • 2021-02-04 10:16

    What am I doing wrong here?

    Nothing, you are just using a default 3.1 install which uses the new sprockets-based asset pipeline.

    put your stylesheets into /app/assets/stylesheets and use

    <%= stylesheet_link_tag 'application.css' %> 
    

    in your views

    the new pipeline takes all the stylesheets in that folder and automagically compiles them into a single file.

    ==

    Alternatively, you can set turn the new pipline off in your application.rb with

    config.assets.enabled = false
    
    0 讨论(0)
提交回复
热议问题