Closed camerican closed 7 years ago
If we wish to render only certain routes via Rails' resources method, we can pass through an options hash that includes the exceptions we wish to omit (or a list of the routes we wish to include).
resources
resources :posts, except: [:destroy,:update,:create,:new,:edit] # or resources :posts, only: [:index, :show]
Either of the above resources should result in the same resultant routes.
references: [StackOverflow]
If we wish to render only certain routes via Rails'
resources
method, we can pass through an options hash that includes the exceptions we wish to omit (or a list of the routes we wish to include).Either of the above resources should result in the same resultant routes.
references: [StackOverflow]