Skip to content

Instantly share code, notes, and snippets.

@chenillen
Created July 24, 2010 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenillen/488291 to your computer and use it in GitHub Desktop.
Save chenillen/488291 to your computer and use it in GitHub Desktop.
## 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