rails/rails — Issue #3301: Regex with a period route fails
Author: tc
Created: 2011-10-12 00:56:45+00:00
State: open

I have a route file where a regex matcher works in a resource scope but not in the match method:

routes.rb:
```
regex = /[\w\d\s!\.]+?/
resources :pages, :id => regex do
member do
get 'embed'
end
end
match "/embed/:id" => "pages#embed", :id => regex
```

pages_controller.rb:
```
def embed
id = params[:id]
render :text => "id is #{id}"
end
```
This route works:
http://localhost:3000/pages/Edwin.Lee/embed
id is Edwin.Lee

This one fails:
http://localhost:3000/embed/Edwin.Lee
id is Edwin