Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

api for new user

  • Loading branch information...
commit 5edf8ed6741def6d832dc0748791752a6693048a 1 parent 53a8091
Eladio Ruiz authored
Showing with 15 additions and 2 deletions.
  1. +12 −0 app/controllers/api_controller.rb
  2. +3 −2 config/routes.rb
View
12 app/controllers/api_controller.rb
@@ -161,6 +161,18 @@ def uploadmatch
render :json => @res.to_json()
end
+ def newuser
+ @token = params[:token]
+ @user_name = params[:user_name]
+ @user_email = params[:user_email]
+ @user_login = params[:user_login]
+ @user_password = params[:user_name]
+ @user_handicap = params[:user_handicap]
+
+ @user = User.new({:name => @user_name, :email => @user_email, :login => @user_email, :password => @user_password, :handicap => @user_handicap});
+ @user.save
+ end
+
private
def format_nil(value,default)
View
5 config/routes.rb
@@ -50,12 +50,13 @@
map.connect '/api/getcourse', :controller => 'api', :action => 'infocourse', :conditions => {:method => :post}
map.connect '/api/getmatches', :controller => 'api', :action => 'getmatches', :conditions => {:method => :post}
map.connect '/api/getmatch', :controller => 'api', :action => 'getmatch', :conditions => {:method => :post}
- map.connect '/api/deletematch', :controller => 'api', :action => 'deletematch'#, :conditions => {:method => :post}
+ map.connect '/api/deletematch', :controller => 'api', :action => 'deletematch', :conditions => {:method => :post}
map.connect '/api/getfriends', :controller => 'api', :action => 'getfriends', :conditions => {:method => :post}
map.connect '/api/getinfoholes', :controller => 'api', :action => 'getinfoholes', :conditions => {:method => :post}
map.connect '/api/getstrokes', :controller => 'api', :action => 'getstrokes', :conditions => {:method => :post}
map.connect '/api/uploadmatch', :controller => 'api', :action => 'uploadmatch', :conditions => {:method => :post}
- map.connect '/api/uploadmatchform', :controller => 'api', :action => 'uploadmatchform'
+ map.connect '/api/uploadmatchform', :controller => 'api', :action => 'uploadmatchform', :conditions => {:method => :post}
+ map.connect '/api/newuser', :controller => 'api', :action => 'newuser', :conditions => {:method => :post}
map.resources :users
Please sign in to comment.
Something went wrong with that request. Please try again.