the group more structured and also demo connecting with gmail account..
This commit is contained in:
1 parent
1b7fb106f8
commit
769a67f026
5 files changed
+87
-208
No files matched your search
@@ -6,10 +6,17 @@ class OtheraccountsController< ApplicationController
|
||||
include REXML
|
||||
|
||||
def saveaccountinfo
|
||||
@dowhat = params['dowhat']
|
||||
@email = params['email']
|
||||
@password = params['password']
|
||||
@account = params['account']
|
||||
OtherAccount.create(user_id: current_user.id, email: @email, encrypted_password: @password, type: @account)
|
||||
case @dowhat
|
||||
when "new"
|
||||
OtherAccount.create(user_id: current_user.id, email: @email, encrypted_password: @password, type: @account)
|
||||
when "edit"
|
||||
@otheraccount = OtherAccount.where(:type.all => [@account],:user_id.all => [current_user.id])
|
||||
@otheraccount.first.update_attributes(:email => @email, :encrypted_password => @password)
|
||||
end
|
||||
a = Array.new
|
||||
a << {"success"=>"true"}
|
||||
render :json=>a.to_json
|
||||
|
||||
Reference in new issue
Block a user