Hi all
I need to display the whole address that''s in the address bar of the
browser in a view.
http://localhost:3000/my_controller/my_action
I tried with request.request_uri, but sadly this only gives me the path
after the domain and port:
/my_controller/my_action
I saw that request.env_table[''REQUEST_URI''] gives me the
wanted result,
but it seems that this is not available in testing environment.
So i hacked this dirty little helper:
def whole_url
protocol + host_with_port + request_uri
end
But I guess it''s not very error proven, because what happens when the
default port is used and I only need
http://www.mysite.xxx/my_controller/my_action
but whole_url gives me
http://www.mysite.xxx:80/my_controller/my_action
? So I guess there''s for sure a better way to solve my problem... Any
hints? Thanks. :-)
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---