From 029373addd4087d66c13741a3ca765654ed3f9ca Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 3 Jan 2013 20:32:17 -0500 Subject: [PATCH] i18n for outfits#destroy flashes --- app/controllers/outfits_controller.rb | 25 +++++++++---------------- config/locales/en-meep.yml | 3 +++ config/locales/en.yml | 3 +++ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/controllers/outfits_controller.rb b/app/controllers/outfits_controller.rb index 7bd48327..6c16f28f 100644 --- a/app/controllers/outfits_controller.rb +++ b/app/controllers/outfits_controller.rb @@ -28,22 +28,15 @@ class OutfitsController < ApplicationController end def destroy - if @outfit.destroy - respond_to do |format| - format.html { - flash[:success] = "Outfit #{@outfit.name} successfully deleted" - redirect_to current_user_outfits_path - } - format.json { render :json => true } - end - else - respond_to do |format| - format.html { - flash[:alert] = "Error deleting outfit. Try again?" - redirect_to current_user_outfits_path, :status => :bad_request - } - format.json { render :json => false, :status => :bad_request } - end + @outfit.destroy + + respond_to do |format| + format.html { + flash[:success] = t('outfits.destroy.success', + :outfit_name => @outfit.name) + redirect_to current_user_outfits_path + } + format.json { render :json => true } end end diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index 6b147421..bfbde555 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -438,6 +438,9 @@ en-meep: submit: Meemport all pets outfits: + destroy: + success: Outfit "%{outfit_name}" succeessfully demeeped. + new: tagline: Meeps made meepy! load_pet_legend: Enter your pet's meep diff --git a/config/locales/en.yml b/config/locales/en.yml index 9f582407..dab1c900 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -439,6 +439,9 @@ en: submit: Import all pets outfits: + destroy: + success: Outfit "%{outfit_name}" successfully deleted. + new: tagline: Neopets wearables made easy! load_pet_legend: Enter your pet's name