Rails how to request url except URL parameters?
I create this link tag:
<link rel="canonical" href="<%= request.url %>" /> The only problem is that this is a complete url with parameters.
How can I request a url without any parameters?
+7
Rails beginner
source share2 answers
request is ActionDispatch :: Request and subclasses of Rack :: Request. Rack :: Request has a path method that might interest you:
<%= request.path %> If your request.url is http://example.com/where/is?pancakes=house%3F , then request.path should be /where/is .
+10
mu is too short
source share