css - Not able to include external stylesheet in rails application -
i have style.css file in assets/stylesheets directory , in html i'm using<%= stylesheet_link_tag "/stylesheets/style.css" %>. tried inspect element check it, , css file not being included.
your problem has hallmarks of rails asset pipeline problem
- do have application.css.erb this? it's created default , serves backbone css aspect of asset pipeline in rails.
/* ... *= require_self *= require_tree . */ - using asset pipeline means call "/stylesheets/style.css" never valid in production , should avoided in code.
if you're seeing problem in production, did rake assets build fingerprinted filenames?
the raked filenames mangled like: /assets/style-4dd5b109ee3439da54f5bdfd78a80473.css, can see why using filename "style.css" not work.
# rake assets production $bundle exec rake assets:precompile rails_env=production debug
to me step 1 making sure pipeline setup serve css assets. until works, css broken. ask first check on application.css.erb, make sure app includes css tree in pipeline. run production rake, tell happening css assets. if post output question, see which, if css being included in app.
required reading doing rails apps asset pipeline guide
Comments
Post a Comment