Welcome Guest | Login

reading the url

is there a way to read the url using ruby on rails? for example, if the url is "www.example.com/about" can you obtain the entire url?

2007-02-24 02:30 PM

Where is it you're trying to read the URL from? eg is this in an application? From a clients web-browser? Originating URL?

2007-02-24 05:16 PM

Seth
i was hoping to read this in the controller itself. so if www.example.com was routed to the controller ExampleController, action index, i would want to read the url from there. what i'm trying to do is have multiple urls mapped to a controller, and then read what url it's coming from in that controller.

2007-02-24 05:22 PM

ok, i figured it out, you just have to do @request.domain to get the domain, and you can find a bunch of other stuff through that as well.

2007-02-26 01:43 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!