← all posts

7 October 2008

Orderly Code is Readable Code

We were talking in #offrails today about coding standards and a few points came up on how to lay out “good” rails code. They were:

For controllers I would put filters first, then the 7 restful actions (index, show, new, create, edit, update and destroy) and then the custom actions and then if I needed to find a parent resource (for example /forums/1/topics) I would call private and then put a find_forum method there.

— Ryan

Got a thought? Email me or find me on Mastodon.

Before this: The Super-Consumer

After this: Two Guys Break Into A Car...