Forum: Ruby on Rails Routers and dot in string parameter.

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.
Ead43bcb0202410540a6a7cee5955d46?d=identicon&s=25 Fresh Mix (giga)
on 2009-03-16 19:01
map.page ':sex/:word', :controller => 'say',
  :requirements => { : sex =>/girl|boy/ }


So this works fine:

http://mypage.com/say/boy/hello

also this:

http://mypage.com/say/girl/hello%20world

but this:

http://mypage.com/say/girl/hello.world

returns: Error 404 The page you were looking for doesn't exist.

How can I fix this?
2505b282d57c29be797dc35b245adb4c?d=identicon&s=25 Philip Hallstrom (Guest)
on 2009-03-16 19:09
(Received via mailing list)
> http://mypage.com/say/girl/hello%20world
>
> but this:
>
> http://mypage.com/say/girl/hello.world
>
> returns: Error 404 The page you were looking for doesn't exist.
>
> How can I fix this?

I had a route like this once where :code was a series of numbers and
periods.  The below made it work.

     r.foo_detail '/foo/:code/:title/detail',
                         :action => 'detail',
                         :requirements => { :code => %r([\d.]+) }
This topic is locked and can not be replied to.