Tag route

4 votes

0 comments

2188 views

Overuse route customizations

According to Roy Fielding’s doctoral thesis, we should use restful routes to represent the resource and its state. Use the default 9 actions without overusing route customizations.

implemented
by ihower
ihower

5 votes

2 comments

3187 views

Needless deep nesting

Some people will define 3 or more level nested routes, it's a kind of over design and not recommended.

implemented
by ihower
ihower

9 votes

0 comments

2821 views

Not use default route if you use RESTful design

If you use RESTful design, you should NOT use default route. It will cause a security problem. I explain at http://ihower.tw/blog/archives/3265 too.

implemented
by ihower
ihower

20 votes

6 comments

7820 views

split route namespaces into different files

the routes will become complicated with the growth of your application, contain different namespaces, each with a lot of resources and custom routes, it would be better to split routes into different files according to the namespaces, which makes it easy to maintain the complicated routes.

flyerhzm

10 votes

5 comments

4051 views

Restrict auto-generated routes.

By default, Rails generates seven RESTful routes(new,edit,create,destroy,index,show, update) for a resource, sometime the resource only needs one or two routes, so just user :only or :except while defining routes to speedup the routing.

implemented
by yorzi
yorzi
Fork me on GitHub