Helpers in rails to get URL (using AJAX)

Hello all,
I am trying to get (using Ajax) the URL which is sent to the server
when I click on a button/link
Also, I want to store the results from this URL request
Did somebody know helper in Rails which allow me to do that ?
In the same way, how can I get my current IP address using Ajax, in
rails ?