7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/pup/routing/route_helpers.rb', line 7
def resources(resource, options = {})
actions = get_required_actions(options)
get("/#{resource}", to: "#{resource}#index") if actions.include?(:index)
get("/#{resource}/new", to: "#{resource}#new") if actions.include?(:new)
post("/#{resource}", to: "#{resource}#create") if actions.include?(:create)
get("/#{resource}/:id", to: "#{resource}#show") if actions.include?(:show)
get("/#{resource}/:id/edit", to: "#{resource}#edit") if actions.include?(:edit)
put("/#{resource}/:id", to: "#{resource}#update") if actions.include?(:update)
patch("/#{resource}/:id", to: "#{resource}#update") if actions.include?(:update)
delete("/#{resource}/:id", to: "#{resource}#destroy") if actions.include?(:destroy)
end
|