From 3dbb80bf9f432842fa7912957d2739127ec747eb Mon Sep 17 00:00:00 2001 From: maxwell Date: Wed, 8 Dec 2010 14:05:30 -0800 Subject: [PATCH] added slightly better error message on aspect update failure --- app/controllers/aspects_controller.rb | 7 ++++--- config/locales/diaspora/en.yml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 45e7bcc26..ad49b8358 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -83,9 +83,10 @@ class AspectsController < ApplicationController def update @aspect = current_user.aspect_by_id(params[:id]) - - @aspect.update_attributes( params[:aspect] ) - flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name + if @aspect.update_attributes( params[:aspect] ) + flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name + else + flash[:notice] = I18n.t 'aspects.update.failure',:name => @aspect.name respond_with @aspect end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 99796c890..4eff0acb1 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -144,6 +144,7 @@ en: success: "%{name} was successfully removed." update: success: "Your aspect, %{name}, has been successfully edited." + failure: "Your aspect, %{name}, had too long name to be saved." move_contact: failure: "didn't work %{inspect}" success: "Person moved to new aspect"