Skip to content

Commit 3a7edb6

Browse files
committed
Moving from a nested resource route to individual search entry mappings
1 parent d4a4742 commit 3a7edb6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

chef-server-slice/lib/chef-server-slice.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,13 @@ def self.setup_router(scope)
8181

8282
scope.match("/status").to(:controller => "status", :action => "index").name(:status)
8383

84-
scope.resources :searches, :path => "search", :controller => "search" do
85-
scope.resources :entries, :controller => "search_entries"
86-
end
84+
scope.resources :searches, :path => "search", :controller => "search"
85+
scope.match("/search/:search_id/entries", :method => 'get').to(:controller => "search_entries", :action => "index")
86+
scope.match("/search/:search_id/entries", :method => 'post').to(:controller => "search_entries", :action => "create")
87+
scope.match("/search/:search_id/entries/:id", :method => 'get').to(:controller => "search_entries", :action => "show")
88+
scope.match("/search/:search_id/entries/:id", :method => 'put').to(:controller => "search_entries", :action => "create")
89+
scope.match("/search/:search_id/entries/:id", :method => 'post').to(:controller => "search_entries", :action => "update")
90+
scope.match("/search/:search_id/entries/:id", :method => 'delete').to(:controller => "search_entries", :action => "destroy")
8791

8892
scope.match("/cookbooks/_attribute_files").to(:controller => "cookbooks", :action => "attribute_files")
8993
scope.match("/cookbooks/_recipe_files").to(:controller => "cookbooks", :action => "recipe_files")

0 commit comments

Comments
 (0)