ruby - Default :exclude option for Rails resource routing -
A minor question:
I am using the rail for my REST API, but since This is a bad API; I do not really have to route : new
or :
edit for any resource because people only through automatic JSON requests Will interact with the API, not graphically For example, there is no need for a dedicated edit page.
Currently, I have to do something to define every resource:
# routes.rb Processing: People in / config / routes
except for option on each resource : there is no big deal: [: new,: edit]
rb but is it fixed Is there a way to do that I do not need to specify this on every resource? I would like to vacate this code for a while, such as passing some local option along with some local options like lame without something.
More generally, can you define the default options for rail routes :
?
Thank you!
For the rescue!
with-option (except: [: new,: edit]). Opt. Opt.resource: session opt.resource: other_resource opt.resources: end of people
Comments
Post a Comment