Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Hi,
when the "Agile Web D." book talks about routes, there are what
looks like console transcripts like the following:
URL> store
@params = {:controller => 'store', :action = 'index'}
Is there something like a console for testing routes (where you could
put in a url and see how rails would route it)??
Ingo

Is there any way to do that sort of thing from a controller? Giving
some function a path and then getting the params that path would
produce?
For example, passing this to some function:
"/store/edit/1"
and getting back
[:controller => "store", :action => "edit", :id => "1"]
or whatever the appropriate params for the route are.
-- Michael D.

I've seen that, which is good, but I mean from within an action in a
controller or elsewhere, not from the console.
At some point, my application gets lists of URLs, and I want to know
what params their paths produce.
(Plus, oops! Those should have been curly braces.)
-- Michael D.
On Apr 4, 2006, at 12:00 PM, Tobias Lütke wrote:

Michael D. wrote:
> I've seen that, which is good, but I mean from within an action in a> controller or elsewhere, not from the console.>> At some point, my application gets lists of URLs, and I want to know> what params their paths produce.
This might help:
http://clarkware.com/cgi/blosxom/2006/04/04#HeadlessApp
--
Ray