How to get the previous URL in Rails? Not the URL that you got a request from, but the one before that?
Because I'm getting an AJAX request, and I need the URL for the page they are currently on (or the URL before the AJAX).
You can write request. url instead of request. request_uri . This combines the protocol (usually http://) with the host, and request_uri to give you the full address.
Run RubyMine and click New Project on the Welcome Screen. Name: specify a name for the project (rails-helloworld in our case). Location: specify a path to the directory in which you want to create the project. By default, RubyMine creates a directory with the same name as the project.
Ruby on Rails, sometimes known as "RoR" or just "Rails," is an open source framework for Web development in Ruby, an object-oriented programming (OOP) language similar to Perl and Python.
Try to use HTTP_REFERER
.
In Rails: request.referrer
or request.headers["HTTP_REFERER"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With