Skip to content

Instantly share code, notes, and snippets.

@jcasimir jcasimir/routes.rb
Created Jun 24, 2011

Embed
What would you like to do?
Solution for "RouterTester" Example
RouterTester::Application.routes.draw do
resources :employees do
resources :evaluations do
resources :scores
end
member do
put :promote
end
end
resources :managers do
collection do
get :generate_statistics
end
end
match '/bosses' => redirect("/managers")
match '/bosses/:id' => redirect("/manaagers/#{id}")
match '/directory' => "employees#index", :as => 'directory'
match '/search(/:group(/:name))' => "searches#new", :as => 'search'
root :to => "managers#index"
end
@solsberg

This comment has been minimized.

Copy link

solsberg commented Jan 5, 2012

SHouldn't the root route be as follows?
root :to => "managers#index"

@jcasimir

This comment has been minimized.

Copy link
Owner Author

jcasimir commented Jan 6, 2012

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.