Forum: Ruby on Rails Newbie routing problem.

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.
Brij N. (Guest)
on 2007-03-28 16:20
Hi, I have a (hopefully) simple problem that just doesn't want to work:

I have a mapping in my routes.rb file:

  map.connect 'images/theme/:filename',
    :controller => 'theme', :action => 'images'


If I then go to url: http://localhost:3000/images/theme/bullet_blue.jpg

I get following error:

Routing Error
no route found to match "/images/theme/bullet_blue.jpg" with
{:method=>:get}



However, if I go to url:
 http://localhost:3000/images/theme/bullet_blue, the action is executed
correctly.

Why does the mapping not correspond to a real filename containing an
extension?

thanks!
Russell N. (Guest)
on 2007-03-28 19:12
(Received via mailing list)
Does

map.connect 'images/theme/:filename.:format', :controller => 'theme',
:action => 'images'

work? You might have to play around with that dot and the :format
reference
but I think that's how it's done. I've never used it myself though.
Someone
else with some experience might want to clarify.

RSL
This topic is locked and can not be replied to.