zurb/foundation-rails — Issue #16: image-url('stuff') not generating proper asset urls
Author: randito
Created: 2011-12-22 02:52:24+00:00
State: open

I am having an issue with the foundation images not be served correctly through the CSS assets.

The assets pipeline helper -- `image-url` -- is not generating the right url. The Rails guide says that this helper should generate the proper asset url: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets

I am getting warnings from sprockets when I run a local rails server, via `rails s`:

Started GET "/images/foundation/misc/button-gloss.png" for 127.0.0.1 at 2011-12-21 20:33:25 -0600
ActionController::RoutingError (No route matches [GET] "/images/foundation/misc/button-gloss.png"):

The gem source has the `image-url` helper:

.button.nice {
background: #00a6fc image-url("foundation/misc/button-gloss.png") repeat-x 0 -34px;

However, if I open up the generated /assets/application.css file, I can see the generated css:

.button.nice {
background: #00a6fc url('/images/foundation/misc/button-gloss.png') repeat-x 0 -34px;

It does not have proper "/assets/foundation/misc/button-gloss.png" Am I missing something obvious?

1. Added 'zurb-foundation' and 'compass' to my Gemfile.
2. Added '*= require foundation' to my app/assets/application.css using the `rails g foundation:install` command.