Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm getting the following error in a Rails app (doing a GET request for an image that doesn't exist:):

ActionController::RoutingError (No route matches [GET] "/assets/images/ui-bg_flat_75_ffffff_40x100.png"):
actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
...

It looks like a known error in jquery-ui.css

These sites talk about it:

jquery-ui.css images

Fixed jQuery UI CSS and image location to work with minified assets

And

Bug report

I have jquery-ui.css in my stylesheets folder. It is this version: /*! jQuery UI - v1.9.2 - 2012-11-23

Line 246 has:

url(images/ui-bg_flat_75_ffffff_40x100.png)

But, I don't know how to fix it.

Any help would be appreciated!

like image 746
Reddirt Avatar asked May 09 '13 12:05

Reddirt


2 Answers

I believe you can resolve this by viewing your jquery-ui.css and/or jquery-ui.theme.css and finding the line that is pointing to and removing images at the start so therefore it would look like this.

url(ui-bg_flat_75_ffffff_40x100.png)

instead of:

url(images/ui-bg_flat_75_ffffff_40x100.png)

Its looking at the wrong path therefore you will receive this error.

like image 166
Deej Avatar answered Nov 11 '22 00:11

Deej


Rather than modifying the hardcoded url path, you'd be better looking at The Asset Pipeline Rails Guide (css and sass) and using one of the listed asset pipeline helpers.

That way, using the image-path("asset.png") syntax, your referenced asset will always be correct.

like image 35
saywhatnow Avatar answered Nov 11 '22 01:11

saywhatnow