So I understand in order to get the full URL on the browser you need javascript something like:
var url = window.location.href;
This by default will get the compelete URL like:
http://localhost:3000/contacts/#reference
http://localhost:3000/contacts/item
If I place the above javascript code on my application.js
file, how am I going to call it on my server side like for instance on my /helpers/application_helper.rb
file?
Also do I need to put my javascript into a function in order to get access with it?
Please help!
EDIT:
request.fullpath
or request.orginal_url
won't work on special anchor character such as http://localhost:3000/contacts/#reference
that's the reason why I am asking how can I pass the js to server side.