Reputation: 543
I have style.css file in my assets/stylesheets directory and in the html I'm using<%= stylesheet_link_tag "/stylesheets/style.css" %>
. I tried inspect element to check it, and css file is not being included.
Upvotes: 0
Views: 887
Reputation: 116
Go to your config/initializers/assets.rb and include this in the file 'Rails.application.config.assets.precompile += %w( users.css )' , without the quotes, then restart your server.
Upvotes: 0
Reputation: 3057
/* ...
*= require_self
*= require_tree .
*/
If you're seeing this problem in production, did you rake your assets to build the fingerprinted filenames?
The raked filenames are mangled to something like: /assets/style-4dd5b109ee3439da54f5bdfd78a80473.css, so you can see why using the filename "style.css" will not work.
# Rake assets for production
$bundle exec rake assets:precompile RAILS_ENV=production
Debug
To me step 1 is making sure your pipeline is setup to serve CSS assets. Until that works, your CSS will be broken. I would ask you to first check on the application.css.erb, to make sure your app includes your CSS tree in the pipeline. Then run the production rake, this will tell you what is happening with your CSS assets. If you post the output to your question, then we could see which, if any CSS is being included in your app.
Required reading for anyone doing Rails apps is the Asset Pipeline guide
Upvotes: 2
Reputation: 17834
Have you tried this?
<%= stylesheet_link_tag "style.css" %>
or
<%= stylesheet_link_tag "style" %>
Upvotes: 0