I have a rails route that goes to the
#works for "/profile/abc"
/profile/:id
However, it breaks when the url's id is capitalized
#breaks for "/profile/Abc"
/profile/:id
Anyone knows why?
I have a rails route that goes to the
#works for "/profile/abc"
/profile/:id
However, it breaks when the url's id is capitalized
#breaks for "/profile/Abc"
/profile/:id
Anyone knows why?
You can specify constraints for id
explicitly (if Rails says 'no such route'), like
map.connect '/profile/:id', ..., :constraints => { :id => /.+/ }
Then, in your view, you can convert params[:id]
to lower case. Also, if id has upper-case letters, you can redirect user to a proper (lower-case) url.
Although, reading the question again, I don't exactly understand what "breaks" means.