views:

36

answers:

1

Hi folks, really big problem example request

http://localhost:3000/freund/in/münchen

my first route in routes.rb

match ':category/in/:city' => 'home#index', :constraints => {:city => /(berlin|hamburg|münchen)/ }

and I get the error Routing Error

No route matches "/freund/in/m%C3%BCnchen"

what can I do? I postet everywhere :(

A: 

"Real" Unicode characters in URLs are invalid. They usually get percent encoded by the browser, which results in m%C3%BCnchen. You will need to check for that inside Ruby.

This question provides more background: Unicode characters in URLs

Pekka
thanks pekka, i found a workaround for my issue. It's not the prettiest, but I left out the constraints part and do the "validation" check in the controller (grabbing params) this seems to work really great :)
tabaluga
@tabaluga yeah, the input probably gets unescaped before entering the controller. Probably more convenient that way.
Pekka
By the way, your list of major german cities is blatantly incomplete! (*Ahem*)
Pekka