List all available nested resources routes?

hi there,

how do you list all the possible named routes for your nested resources

is there a way to do this from console???

cheers

dion

just found the Routing Navigator plugin

http://blog.caboo.se/articles/2006/06/19/new-plugin-routing-navigator

this sounds promising…

On May 27, 2007, at 11:00 PM, Dion H. wrote:

just found the Routing Navigator plugin

http://blog.caboo.se/articles/2006/06/19/new-plugin-routing-navigator

this sounds promising…

I find the routing plugin to be extremely helpful.
If you still want to find them from the console, keep in mind that
methods for the routes get attached to your controller.

This allows you to do this:

$ ./script/console

a = ApplicationController.new
a.methods.sort.select {|m| m =~ /url$/ }

You can play with the regexp in the select block to filter to exactly
what you’re looking for, but trying it should be illustrative.

Thanks,

David

hey David

thats pretty hand

a.methods.sort.select {|m| m =~ /path$/ }

never thought of parsing regexps through console output

cheers

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs