Take a look at http://routes.groovie.org/setting_up.html#submapper-helpers
The new collection() helper () is a lot more transparent than
resource() - you can control which of the standard routes are
generated (by default it does all of them) and it collapses the
"formatted" route onto its corresponding "unformatted" one, halving
the number of routes generated. And if you want even more control,
you can use submappers and the helpers index(), show() etc directly.
But even the old resource() should work - guess there must be
something else going on.
Personally - though it was me who added collection() so clearly I'm
biased - I think resource() is a dead end. There's only so much
complexity you can add to the interface of a single function before
you should find another way to do it. Submappers provide another
way. There's more background on my blog if you're interested (google
for "DRY up your routes - a Pylons routing refactoring").
$ paster routes development.ini
will print out your routes in a style similar to "rake routes" in
Rails.
You will get the same output in the paster shell with "print mapper".
While you're there, "mapper.matchlist" will give a list of Route
objects. Try for example "[route.name for route in
mapper.matchlist]". Try also "mapper.routematch('/incidents'). And
of course "help(mapper.collection)" ;-)
Mike
[email protected]
http://positiveincline.com
http://twitter.com/asplake
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.