Created
July 24, 2010 01:30
-
-
Save chenillen/488291 to your computer and use it in GitHub Desktop.
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
## Want a route like http://example.com/:id/photos in Rails 3 | |
# I have a username route below | |
class User < ActiveRecord::Base | |
def to_param | |
screen_name | |
end | |
end | |
match ':id' => 'users#show', :as => 'user_profile' | |
resources :photos | |
you know we could not write a route like this | |
match ':id' => 'users#show', :as => 'user_profile' do | |
resources :photos | |
end | |
# How could i nest settings resources in a named route? | |
# Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment