# Routers and dot in string parameter

**URL:** <https://www.ruby-forum.com/t/routers-and-dot-in-string-parameter/163019>\
**Category:** Rails\
**Created:** [March 16, 2009, 7:01pm UTC](https://www.ruby-forum.com/t/routers-and-dot-in-string-parameter/163019 "2009-03-16T19:01:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![giga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b9bd4f/32.png) [@giga](https://www.ruby-forum.com/u/giga)\
**Post date:** [March 16, 2009, 7:01pm UTC](https://www.ruby-forum.com/t/routers-and-dot-in-string-parameter/163019/1 "2009-03-16T19:01:52Z")

</div>

map.page ‘:sex/:word’, :controller =\> ‘say’,  
:requirements =\> { : sex =\>/girl|boy/ }

So this works fine:

[http://mypage.com/say/boy/hello](http://mypage.com/say/boy/hello)

also this:

[http://mypage.com/say/girl/hello%20world](http://mypage.com/say/girl/hello%20world)

but this:

[http://mypage.com/say/girl/hello.world](http://mypage.com/say/girl/hello.world)

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

How can I fix this?

---

<div class="post-metadata">

**Author:** ![giga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b9bd4f/32.png) [@giga](https://www.ruby-forum.com/u/giga)\
**Post date:** [March 16, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/routers-and-dot-in-string-parameter/163019/2 "2009-03-16T19:09:17Z")

</div>

> [http://mypage.com/say/girl/hello%20world](http://mypage.com/say/girl/hello%20world)
> 
> but this:
> 
> [http://mypage.com/say/girl/hello.world](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.]+) }

```
