what's the equivalent of doing rails style url globbing with Merb's
router?

Example:
If someone connects to
/files/list/base/books/fiction/dickens

you want the files/list action to have access to all four remaining
fields. But sometimes there might be only three fields:
/files/list/base/books/fiction

or five:
/files/list/base/books/fiction/dickens/little_dorrit

So you need a route that will match (in this particular case)
everything after the second URI component.

You can do that with a route glob. You "glob" the route with an
asterisk:
map.connect 'files/list/*specs'

Now, the files/list action will have access to an array of URI fields,
accessible via params[:specs]:
def list
  specs = params[:specs] # e.g, ["base", "books", "fiction",
"dickens"]
end

http://tinyurl.com/6a26le
as explained:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to