None of the suggestions here in the thread helped me sadly, except the one where someone said he used the debugger to find what he looked for.
I've created some custom error pages instead of the standard 404 and 500, but request.url ended in /404 instead of the expected /non-existing-mumbo-jumbo.
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:
For rails 3 :
None of the suggestions here in the thread helped me sadly, except the one where someone said he used the debugger to find what he looked for.
I've created some custom error pages instead of the standard 404 and 500, but
request.url
ended in/404
instead of the expected/non-existing-mumbo-jumbo
.What I needed to use was
For Ruby on Rails 3:
I fired up a debugger session and queried the request object:
In Rails 3 you can use
http://apidock.com/rails/v3.2.8/ActionDispatch/Request/original_url
Rails 4.0
you can use
request.original_url
, output will be as given below example