Forum: Ruby on Rails RoutingError from css background image url

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
sparky (Guest)
on 2008-10-18 00:07
(Received via mailing list)
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
This topic is locked and can not be replied to.