Skip to content

Instantly share code, notes, and snippets.

@jdar
Forked from rhynix/gist:182485
Created September 7, 2009 18:03
Show Gist options
  • Save jdar/182486 to your computer and use it in GitHub Desktop.
Save jdar/182486 to your computer and use it in GitHub Desktop.
map.resources :users, :except=>[:new, :create]
map.resources :users, :only=>[:new,:create], :as => :register
# Creates these routes
users GET /users(.:format) {:controller=>"users", :action=>"index"}
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"}
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"}
PUT /users/:id(.:format) {:controller=>"users", :action=>"update"}
DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"}
POST /register(.:format) {:controller=>"users", :action=>"create"}
new_user GET /register/new(.:format) {:controller=>"users", :action=>"new"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment