From e7a0d77fd4f43ebab55a9040a8ae5c4290370e62 Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 29 Dec 2014 14:54:32 +0100 Subject: [PATCH] changed flash thing --- app/controllers/user_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index ffad7d8f..8124e1e8 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -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