On Jul 31, 2006, at 9:41 PM, David Heinemeier Hansson wrote:
Postbacks aside, I still think inverting the optional actions hashes
(key by method instead of action) is still a better way to go. It's
less to type, less to transform, and I tend to think of the actions
grouped by http method anyway (at least when doing restful routes).
It's not a huge difference so if I'm a lone voice on this I'll shut
up, but I did want to at least put it forth as an option.
I actually consider the verbosity a feature in this case. If you're
writing so many additional methods that the repetition is beginning to
bug you, you should revisit your intentions. You're probably not being
as RESTful as you could be.
Just checking... You think that code that is less readable and more
tedious to write is an advantage? I guess from the perspective of
macro-optimization vs micro-optimization I wouldn't argue with you,
but I think that's a hell of a way to encourage people to do the
right thing. If going restful is all that, you shouldn't need to
rely on syntactic vinegar to force people to do it the right way.
Now, if you were to say that organizing the actions hash as {:action
=> method, ...} is desirable because it guarantees an action only is
used once, then sure, that makes sense. Either way, I can get behind
it.
--
Josh Susser
http://blog.hasmanythrough.com
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core