Using Rails, I have a model "User", for which the action "Show" routes to users/:name
. Usually it works fine, except that when there's a period (.) in the name, the server can no longer find the record. For example, http/localhost:3000/Joe%20Jr.
.
How can I fix this?
routes.rb:
get 'users/:name', to: "users#show", as: 'user'
get 'users/:id/edit', to: "users#edit", as: "edit_user"
resources :users
users_controller.rb:
def create
#...
redirect_to user_path
end