Jacques, Any automated solution would have to be smart about action-args, too. For example, imagine the index action requires a parent_id:
class Children def index(parent_id) end end Then resources :children would not generate an index action, but resources :parent do resources :children end would generate the index action. ..tony.. On Wed, Dec 17, 2008 at 12:19 PM, Jacques Crocker <[email protected]>wrote: > > Seems like it would be even simpler if before defining each route (for > a resource), it did a respond_to? on the controller class to check for > the associated method. If the method doesn't exist, then just don't > define the route. > > 3-4 lines of code to implement and no new syntax and configuration > needed. > > On Dec 17, 12:13 pm, "Tony Mann" <[email protected]> wrote: > > I do indeed admire the simplicity of the resources syntax, especially > with > > the block parameters gone. However, a small addition to the syntax in > order > > to select which actions to support does not seem overly complex to me. > For > > example: > > > > resources :foo, :actions => [:index, :update] > > > > ..tony.. > > > > On Wed, Dec 17, 2008 at 11:43 AM, Michael Klishin < > > > > [email protected]> wrote: > > > > > On 17.12.2008, at 21:05, Tony Mann wrote: > > > > > > This is why I am looking forward to the Resource enhancements that > > > > Yehuda keeps mentioning. It would be great to have a more concise > > > > way of specifying the CRUD routes. > > > > > Keep in mind Merb router is already quite powerful and quite complex. > > > Making it even more complex may not be worth new features, that's one > > > of the reasons why some of them are still not implemented. So, ask > > > yourself: are shallow routes worth losing Merb core simplicity? They > > > may be worth it, I won't judge. > > > > > MK > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
