Hey Tony (and really everyone else :-) Sorry, my answer isn't really related to the original question, but if you're interested in DRYing up your controllers you might want to look at
http://github.com/snusnu/merb_resource_controller/tree/master I just pushed a few fixes and features. The main new feature being support for all kinds of content types. XML, JSON, YML and CSV work out of the box. For others, configuration is really simple. It also supports arbitrarily nested resources (although 2 level nestings *should* be enough most of the times) and singleton resources. It also uses the same controller class for different parent nestings and gives you helpers for parent_resource URLs although these could definitely be approved! Let me know what you think cheers snusnu On Wed, Dec 17, 2008 at 22:41, Michael Klishin <[email protected]> wrote: > > > On 18.12.2008, at 0:34, Tony Mann wrote: > >> On a related note, it would be great to have a #resource method in >> Controller that would grab :id from params and instantiate the >> class. No more foo = Foo.get(id) all over the controller code! > > > Here you go: http://gist.github.com/37243 > > 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 -~----------~----~----~----~------~----~------~--~---
