开发者

What is the convention for ordering the controller actions in Rails?

Given a controller which implements all the CRUD actions: new, create, delete, edit, i开发者_StackOverflowndex show, update, and also a few custom actions, is there any conventional (official or not) order these action should adhere to?


The "official" order (as generated by the rails scaffold) is the following

index show new edit create update destroy

Although I always do index show new create edit update destroy because I think it's a tad more logical to have the actual action that does the work, like create and update after the new and edit actions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜