reading the url
- Vikas
- Posts: 9
- Starts: 5
- Wiki Edits: 0
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?
- Seth
- Posts: 19
- Starts: 2
- Wiki Edits: 4
- Location: Minnesota
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- Vikas
- Posts: 9
- Starts: 5
- Wiki Edits: 0
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
- Vikas
- Posts: 9
- Starts: 5
- Wiki Edits: 0
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.