Created
May 23, 2014 00:18
-
-
Save Rolilink/0555b9c35f04391ab0ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_myself | |
@user = current_user | |
role = Role.find(params[:user][:role_ids]) unless params[:user][:role_ids].nil? | |
params[:user] = params[:user].except(:role_ids) | |
if @user.update_attributes(params[:user]) | |
@user.update_plan(role) unless role.nil? | |
render :json => {success:true} | |
else | |
render :json => {success:false} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment