Created
December 5, 2011 15:55
-
-
Save ahoward/1434053 to your computer and use it in GitHub Desktop.
scope gives cleaner routes compared to nested resources
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
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