Refactor user creation actions

Create a separate #create action that handles POSTs to
/user/new. This simplifies the other actions and ensures
that the URL is /user/new when validation errors occur,
rather than /user/terms.

Fixes #398
This commit is contained in:
John Firebaugh 2013-07-31 16:20:26 -07:00 committed by Tom Hughes
parent c4edac9fd8
commit 849e874dce
5 changed files with 94 additions and 79 deletions

View file

@ -134,7 +134,8 @@ OpenStreetMap::Application.routes.draw do
match '/key' => 'site#key', :via => :get
match '/id' => 'site#id', :via => :get
match '/user/new' => 'user#new', :via => :get
match '/user/terms' => 'user#terms', :via => [:get, :post]
match '/user/new' => 'user#create', :via => :post
match '/user/terms' => 'user#terms', :via => :get
match '/user/save' => 'user#save', :via => :post
match '/user/:display_name/confirm/resend' => 'user#confirm_resend', :via => :get
match '/user/:display_name/confirm' => 'user#confirm', :via => [:get, :post]