Thanks very much for that insight, Yehuda.
It "sort of" works. I define the following in my router.rb:
resources :locations do |location|
resources :shops
end
#I have to repeat this else or i get a bad request on the urls.
identify(Location => :to_param, Shop => :to_param) do
resources :locations do |location|
resources :shops
end
end
however, when i specify url(:location, location, shop), it generates
"location/location_id-location_name/shops/location_id-location_name"
rather than the "location/location_id-location_name/shops/shop_id-
shop_name"
Tommy
On Nov 16, 2:32 pm, "Yehuda Katz" <[EMAIL PROTECTED]> wrote:
> You can do:
> identify(Superklass => :meth) do
> # routes here
> end
>
> -- Yehuda
>
> On Sun, Nov 16, 2008 at 8:55 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > > If you ask me, binding resource information to the model is idiotic,
> > > as the model is NOT the resource, it's a sub-set of it.
> > > But hey, we work with what we've got ;-)
>
> > Yes, I would prefer a solution like this:
> > in router.rb
> > resources locations, :default_param => ":id-:name"
> > so when the you call url(:location, location), it will fill it in with
> > "/location/3-san_diego" rather than force everything to using the id "/
> > location/3"
>
> > This solves the issue of search/replacing all the url methods already
> > used and the default resource routes are preserved.
>
> > But Merb doesn't support this way?
>
> --
> Yehuda Katz
> Developer | Engine Yard
> (ph) 718.877.1325
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---