Skip to content

Instantly share code, notes, and snippets.

@Rolilink
Created May 23, 2014 00:18
Show Gist options
  • Save Rolilink/0555b9c35f04391ab0ad to your computer and use it in GitHub Desktop.
Save Rolilink/0555b9c35f04391ab0ad to your computer and use it in GitHub Desktop.
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