I have a url like this: /hello/world#/lol/backbone
I’d like to get access, in ruby, to the full, entire path. I’d normally do something like this: request.fullpath but that returns only /hello/world and leaves off the #/lol/backbone/
Been Googling for awhile. Can’t seem to find it.
You can’t get the fragment in your server code, the URL fragment (
#/lol/backbone) is a client-side issue. The browser will interpret the fragment but it will not send it to your server.If you need the fragment then you’ll have to convert it to a parameter by intercepting your link with a bit of JavaScript, then the server could see something like
and you could pull the fragment out of
params[:frag]. This does of course assume that your JavaScript link interceptor will get run, that’s not guaranteed so your server-side code should be prepared for a missingparams[:frag].