Rails: routes and special characters like dots
Rails doesn’t seem to like dots and other special chars in its routes.
If you want to use URLs like http://www.domain.com/post/1/just_a_test.. logically the following route seems to be sensible:
map.connect '/post/:id/:title', :controller => 'forum', :action => 'show_post'
But rails won’t like the dots. Use a route like the following to allow a URL with special characters to be routed:
map.connect '/post/:id/:title', :controller => 'forum', :action => 'show_post', :requirements => { :title => /.*/ }
Keywords: dots, dot, no route matches, punkt, punkte, routes.rb, routing, route, rails, problem, won’t work
Filed under: English, Rails 1.2, Rails 2.0, Rails 2.1, Ruby, Ruby On Rails on July 2nd, 2008
Hi, I have got the same problem. Did you find a solution ?!
Thanks.
you’re funny
this post contains the solution