I want to have SEO optimized urls like this
http://example.com/sites/1-blau.de/plans
But the dot in the path cause Rails to chock. How do I escape dots to percentage notation form so it can work?
My routes:
resources :sites, only: [] do
resources :plans, only: [:index, :show] do
end
end
I have tried URI.escape and CGI.escape, neither worked.
URI.escape('a.b')=> "a.b"
CGI.escape('a.b')=> "a.b"
What I thought I wanted
Foo.escape('a.b')=> "a%2Eb"
\.
URI.escape
is working fine.enc_uri = URI.escape("http://example.com/sites/1-blau.de/plans")
=> "http://example.com/sites/1-blau.de/plans"