Due to format convention: Rails will parse all parameters without any dots. You can route parameters with points if you want:
But since the "*" and "+" characters of regular expressions are greedy, it completely ignores the parameter (.: Format).
Now, if you absolutely need to have dots in the username, there is a pseudo workaround that can help you:
map.connect 'users/:id:format', :controller => 'users', :action => 'show', :requirements => { :format => /\.[^.]+/, :id => /.*/ } map.connect 'users/:id', :controller => 'users', :action => 'show'
The disadvantage is that you must include the period in the regular expression: format, otherwise it will be caught by the username expression. Then you need to process the dot format (e.g...json) in your controller.
andersonvom
source share