Add error message when have error on profile screen

This commit is contained in:
Carlos Ribeiro 2015-03-18 23:18:35 -03:00
parent b99221e6f0
commit 2435476167
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ v 7.10.0 (unreleased)
- Fix alignment of navbar toggle button (Cody Mize)
- Identical look of selectboxes in UI
- Move "Import existing repository by URL" option to button.
- Improve error message when save profile has error.
v 7.9.0 (unreleased)
- Add HipChat integration documentation (Stan Hu)

View File

@ -25,7 +25,8 @@ class ProfilesController < ApplicationController
if @user.update_attributes(user_params)
flash[:notice] = "Profile was successfully updated"
else
flash[:alert] = "Failed to update profile"
messages = @user.errors.full_messages.uniq.join('. ')
flash[:alert] = "Failed to update profile. #{messages}"
end
respond_to do |format|