开发者

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

开发者 https://www.devze.com 2023-03-14 03:05 出处:网络
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)

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

精彩评论

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