added slightly better error message on aspect update failure

This commit is contained in:
maxwell 2010-12-08 14:05:30 -08:00
parent f659ba58ef
commit 1f8f07f48d
2 changed files with 5 additions and 3 deletions

View file

@ -83,9 +83,10 @@ class AspectsController < ApplicationController
def update def update
@aspect = current_user.aspect_by_id(params[:id]) @aspect = current_user.aspect_by_id(params[:id])
if @aspect.update_attributes( params[:aspect] )
@aspect.update_attributes( params[:aspect] ) flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name
flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name else
flash[:notice] = I18n.t 'aspects.update.failure',:name => @aspect.name
respond_with @aspect respond_with @aspect
end end

View file

@ -144,6 +144,7 @@ en:
success: "%{name} was successfully removed." success: "%{name} was successfully removed."
update: update:
success: "Your aspect, %{name}, has been successfully edited." success: "Your aspect, %{name}, has been successfully edited."
failure: "Your aspect, %{name}, had too long name to be saved."
move_contact: move_contact:
failure: "didn't work %{inspect}" failure: "didn't work %{inspect}"
success: "Person moved to new aspect" success: "Person moved to new aspect"