Reputation: 5379
I'd like to define a model as a resource to get all the REST URLs.
But, I'd like to disable some of the generated routes (e.g., DELETE). Is there an easy API for this, or do I just need to declare all the routes individually?
Upvotes: 1
Views: 754
Reputation: 16629
you have two ways of doing this
in config/routes.rb
1) as @emm, suggested define only the routes you want
2) use except keyword to exclude
routes
Ex: Excluding destroy action
resources :books, :except => [:destroy]
HTH
Upvotes: 2
Reputation: 2675
You can also exclude specific actions like this:
resources :articles, except: :destroy
Upvotes: 0