# RoutingError from css background image url

**URL:** <https://www.ruby-forum.com/t/routingerror-from-css-background-image-url/151189>\
**Category:** Rails\
**Created:** [October 17, 2008, 10:07pm UTC](https://www.ruby-forum.com/t/routingerror-from-css-background-image-url/151189 "2008-10-17T22:07:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 17, 2008, 10:07pm UTC](https://www.ruby-forum.com/t/routingerror-from-css-background-image-url/151189/1 "2008-10-17T22:07:35Z")

</div>

In my css file, I have a css element that has a background image  
that’s defined as

background: url(/images/global/tab-arrow.gif) no-repeat 16px 8px ;

This throws a Routing Error when an element with that class gets  
rendered

ActionController::RoutingError (No route matches “/images/” with  
{:domain=\>“localhost”, :method=\>:get, :subdomain=\>nil,  
:host=\>“localhost”}):  
/vendor/rails/actionpack/lib/action\_controller/routing/  
recognition\_optimisation.rb:67:in `recognize\_path’

It works fine when the image is copied into the public/images  
directory but doesn’t like it when the image happens to be in a sub  
directory. This looks like the Rails Routing is trying to treat this  
url as a restful resource and I was wondering if anyone else has run  
into this problem and how to go about resolving it.

Thanks in advance.

+s.park
