Restricting automatically generated routes - Hives/acebook-business-logic GitHub Wiki

We were automatically generating all routes for our users and posts resources, some of which were unnecessary. So I restricted the number of routes generated to what we are actually using. This is in line with Rails best practices, and cuts down on memory usage, speeding up the routing process.

It looked like this, and reduced our number of routes from 20 to 12:

resources :users, only: [:create]
resources :posts, only: [:index, :new, :edit, :create, :update, :destroy]

https://rails-bestpractices.com/posts/2011/08/19/restrict-auto-generated-routes/