Created
February 3, 2012 15:06
-
-
Save smd686s/1730597 to your computer and use it in GitHub Desktop.
Get Parent Resource in Rails Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root :to => 'application#index' | |
resources :attractions, :shopping, :accomodations, :restaurants, :events do | |
collection do | |
get 'type' => "#{parent_resource.collection_scope}#index" | |
end | |
member do | |
get 'type' => "#{parent_resource.member_scope}#show" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment