From: Daniel DeLorme Date: 2008-02-10T17:17:04+09:00 Subject: Re: Syntax Opinions Michael Boutros wrote: > Hello, > > I am working on a "framework glue", as in this framework won't make you > lose weight or cure the common cold, it'll just combine the power of > MVC, Sinatra, and DM. However, I'm stuck on what syntax to use for > defining methods in the controller. Since each method will have an HTTP > method, there has to be some way to choose this. Below are my two > options: > > > 1) Enclose the methods in a block with the same name as the HTTP method. > get do > def post > @post = ... > end > end > > 2) My personal favourite which needs no explanation... > def @get.post > @post = ... > end > > What do you guys think? Everyone has their own conventions that fit their brain best. Mine is def edit;end #get def edit!;end #post So it's not so important which convention you choose (i.e. there is no objectively "best" one), just that you be comfortable with it and stick with it for the lifetime of the project. -- Daniel