Hi all, I guess this is more of a cgi question than a Rails one, but I hope there is a Rails (read easy) solution to it. I want to get the full URL of the current page being requested. The same way as request.cgi.referer gives me the full URL of the page I came from. I have looked at the methods of request and request.cgi and seem to have missed it. Any ideas? Many thanks in advance, Nicky
Hi all, I guess this is more of a cgi question than a Rails one, but I hope there is a Rails (read easy) solution to it. I want to get the full URL of the current page being requested. The same way as request.cgi.referer gives me the full URL of the page I came from. I have looked at the methods of request and request.cgi and seem to have missed it. Any ideas? Many thanks in advance, Nicky
Is this what your looking for http://ap.rubyonrails.com/classes/ ActionView/Helpers/UrlHelper.html ? Specifically current _page? and url_for . --- Oliver Legg On 17 Jun 2005, at 07:01, Nickolay Kolev wrote:> Hi all, > > I guess this is more of a cgi question than a Rails one, but I hope > there is a Rails (read easy) solution to it. > > I want to get the full URL of the current page being requested. The > same way as request.cgi.referer gives me the full URL of the page I > came from. > > I have looked at the methods of request and request.cgi and seem to > have missed it. > > Any ideas? > > Many thanks in advance, > Nicky > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Don''t quote me on this, but I believe you can fetch @request.request_uri to get this info. On 6/17/05, Nickolay Kolev <nmkolev-OhoefBWHl6Eb1SvskN2V4Q@public.gmane.org> wrote:> Hi all, > > I guess this is more of a cgi question than a Rails one, but I hope > there is a Rails (read easy) solution to it. > > I want to get the full URL of the current page being requested. The > same way as request.cgi.referer gives me the full URL of the page I > came from. > > I have looked at the methods of request and request.cgi and seem to > have missed it. > > Any ideas? > > Many thanks in advance, > Nicky > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Jun 17, 2005, at 5:47 AM, Michael Gorsuch wrote:> Don''t quote me on this, but I believe you can fetch > @request.request_uri to get this info. >I''ve used @request.path for this as well. I believe they are aliases. Duane Johnson (canadaduane)
Duane Johnson wrote:> I''ve used @request.path for this as well. I believe they are aliases.Keep in mind request.path might not contain the complete URL path. Suppose you have a symlinked apache setup with your rails app located under http://yourhost.com/app/. In this case, request.path will not include ''/app''. Perhaps request.path should be renamed request.rails_path and request.path be made to provide the unadulterated path.