changed flash thing
This commit is contained in:
parent
3e033cc102
commit
e7a0d77fd4
|
@ -16,7 +16,11 @@ class UserController < ApplicationController
|
|||
def update
|
||||
user_attributes = params.require(:user).permit(:display_name, :profile_picture, :motivation_header, :website,
|
||||
:location, :bio, :crop_x, :crop_y, :crop_w, :crop_h)
|
||||
unless current_user.update_attributes(user_attributes)
|
||||
if current_user.update_attributes(user_attributes)
|
||||
text = 'Your profile has been updated!'
|
||||
text += ' It might take a few minutes until your new profile picture is shown everywhere.' if user_attributes[:profile_picture]
|
||||
flash[:success] = text
|
||||
else
|
||||
flash[:error] = 'An error occurred. ;_;'
|
||||
end
|
||||
redirect_to edit_user_profile_path
|
||||
|
|
Loading…
Reference in New Issue