Skip to content

Instantly share code, notes, and snippets.

@smd686s
Created February 3, 2012 15:06
Show Gist options
  • Save smd686s/1730597 to your computer and use it in GitHub Desktop.
Save smd686s/1730597 to your computer and use it in GitHub Desktop.
Get Parent Resource in Rails Router
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