At the moment it's all or nothing, a convention that's left over from Rails. We are planning on reworking the resource routing to make resources more of a first-class concept. When that happens, it will be easy for us to make the resource routes more malleable. In the meantime, if you use the resources() helper but don't define the methods in your controller, the URLs will not be active (because the controller/action pair returned by the router will not be valid).
-- Yehuda On Wed, Dec 17, 2008 at 12:13 AM, Jon Hancock <[email protected]> wrote: > > good question. I also would like to see some discussion on this. I'm > not certain but it seems that some feel that REST implies CRUD. Some > resources do map that way but not all and even when they do, I rarely > want all of those operations exposed. I end up not using resource > definitions in my routes because I don't want all the routes exposed > most of the time. > > I find it easier/safer to incrementally add each route one action at a > time. > But this may be simply because I'm not enlightened ;). > > thanks, Jon > > On Dec 17, 1:36 pm, cult hero <[email protected]> wrote: > > Let's say I go ahead and use "resources <resource>" in my router.rb to > > create some generic routes for something but I only want a subset of > > those routes. (For instance, let's say I don't want to "show" by id, > > but rather, by a slug field.) > > > > Should I create my routes from scratch or is there a good way of > > removing a couple of the routes generated by the resources method? I > > was thinking you could create a controller that just automatically > > raises a NotFound exception, but that seems like a bit of a kludge. > > > > Part of this question comes from me trying to understand CRUD in merb > > but the examples on the wiki all seem to be based around resources > > which is adding an extra layer of stuff for me to grok. > > > > (As a side note, I'm coming from a limited Django background and NOT a > > Rails background, so a lot of these conventions are quite a bit more > > foreign to me than they might be to others.) > > > -- 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 -~----------~----~----~----~------~----~------~--~---
