A minor question:
I am using Rails for my REST API, but since it is a RESTful API I don't really need :new
or :edit
routes for any of my resources since people will only be interacting with this API entirely through automated JSON requests, not graphically. There's no need for a dedicated edit page, for instance.
Currently, I need to do something like this for every resource defined:
# routes.rb
resources :people, except: [:new, :edit]
It's not a big deal to have :except
options on every resource in /config/routes.rb
, but is there a way to define defaults so I don't have to specify this on every resource? I'd like to DRY up this code a bit, without doing something lame like passing around a local variable with default options everywhere.
More generally, can you set default options for Rails routes to follow aside from :exclude
?
Thanks!