How can I get the current absolute URL in my Ruby on Rails view?
The request.request_uri
only returns the relative URL
If you're using Rails 3.2 or Rails 4 you should use request.original_url
to get the current URL.
Documentation for the method is at http://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-original_url but if you're curious the implementation is:
def original_url
base_url + original_fullpath
end