Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created December 5, 2011 15:55
Show Gist options
  • Save ahoward/1434053 to your computer and use it in GitHub Desktop.
Save ahoward/1434053 to your computer and use it in GitHub Desktop.
scope gives cleaner routes compared to nested resources
class Acccount
def to_param
slug
end
end
resources :account do
resources :pages, :controller => 'account/pages'
end #=> account_new_page_path(account)
scope '/account/:account_slug', :module => :account do
resources :pages
end #=> new_page_path(account)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment