Created
November 12, 2014 14:41
-
-
Save washingtonsoares/f967bfdfa386002065c9 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
# PATCH/PUT /users/:id.:format | |
def update | |
# authorize! :update, @user | |
respond_to do |format| | |
if @user.update(user_params) | |
sign_in(@user == current_user ? @user : current_user, :bypass => true) | |
format.html { redirect_to @user, notice: 'Your profile was successfully updated.' } | |
format.json { head :no_content } | |
else | |
format.html { render action: 'edit' } | |
format.json { render json: @user.errors, status: :unprocessable_entity } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment