I am following a Ruby on Rails tutorial, http://ruby.railstutorial.org/chapters/filling-in-the-layout#top and I am stuck at the point where it says how to include the CSS code:
<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
<%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
<!--[if lt IE 8]><%= stylesheet_link_tag 'blueprint/ie' %><![endif]-->
<%= stylesheet_link_tag 'custom', :media => 'screen' %>
This is what I have in my HTML code. The HTML file is under:
/rails_project/sample_app/app/views/layouts$ cat application.html.erb
and the CSS code is under:
/rails_project/sample_app/public/stylesheets/custom.css
but it seems that it doesn’t seem to recognize the CSS code and as a result I just get a plain HTML website.
If you’re using Rails 3.1, you can use the assets pipeline.
Stick your CSS files in app/assets/stylesheets and they’ll be automatically included, compiled iyd they need to be, and minified provided you use code similar to the following in your layout: