Saving settings works ok

This commit is contained in:
magnolia-fan
2011-06-22 03:29:18 +04:00
parent 79c34273c8
commit 9531230f6e
8 changed files with 68 additions and 16 deletions
+14
View File
@@ -26,7 +26,21 @@ class UserController < ApplicationController
end
def update
@res = {}
check = check_auth(params)
if check == true
user = User.find_by_vkid(params[:mid])
unless params[:username].nil? or params[:email].nil?
user.name = params[:username]
user.email = params[:email]
user.save
end
@res[:username] = user.name
@res[:email] = user.email
end
render :json => @res
end
private