I am having issues with asset_path in production. Rails 3.1.1
#config/environments/development.rb
Scc::Application.configure do
# Settings specified here w
Did you rake assets:precompile? By default, Rails will not compile assets in production. The recommended workflow is to compile assets as part of your deployment.
This doesn't look correct:
.right-bar-filler{
background:url(asset_path('right_bar_filler.jpg', image)) repeat-y;
padding-top:0px;
}
If you want to use the asset_path
helper, it needs to run inside the erb tags (<% %>)
.right-bar-filler{
background:url(<%= asset_path('right_bar_filler.jpg', image) %>) repeat-y;
padding-top:0px;
}
and make sure you name the file correctly, i.e. example_filename.css.erb
UPDATE: Sorry, I didn't notice you were using SASS, not CSS. My above answer is not what you need.
Try this instead:
.right-bar-filler{
background:url(asset-path('right_bar_filler.jpg', image)) repeat-y;
padding-top:0px;
}
I.e. I think the asset path helper uses hyphens in SASS, not underscores
http://rubydoc.info/github/petebrowne/sprockets-sass/master/Sprockets/Sass/Functions