Jason Swett
Jason Swett

Reputation: 45094

Rails asset pipeline can't find one certain image

I have a certain image called ui-icons_ffffff_256x240.png. In production it can be found, among other places, in public/assets/images/ui-icons_ffffff_256x240.png.

When I try to view this image in production, I get the following error:

ActionController::RoutingError (No route matches [GET] "/assets/images/ui-icons_ffffff_256x240.png"):

I find this extremely odd since the image most certainly is there:

$ find . -name ui-icons_ffffff_256x240.png
./vendor/assets/stylesheets/jquery-ui/images/ui-icons_ffffff_256x240.png
./public/assets/jquery-ui/images/ui-icons_ffffff_256x240.png
./public/assets/images/ui-icons_ffffff_256x240.png

All the other images in my app work fine and have been forever. I recently upgraded my version of jQuery UI, though, and this one particular image doesn't want to work. (I think it's the only jQuery UI image I'm actually using.)

I'm on Rails 3.2.1. What could be the issue?

Upvotes: 4

Views: 2949

Answers (1)

Soundar Rathinasamy
Soundar Rathinasamy

Reputation: 6728

Your js plugin requests the image with invalid asset url. The asset image can be accessed by

/assets/ui-icons_ffffff_256x240.png

But the requested url is

/assets/images/ui-icons_ffffff_256x240.png

So in your javascript or stylesheet you need to correct asset url manually.

Upvotes: 6

Related Questions