From 362610dc770d12611aaf4aa05c04cd5b4cb11671 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 9 Sep 2010 15:12:01 -0700 Subject: [PATCH] [#4420] Updated the flash messages for Deliverables. --- app/controllers/deliverables_controller.rb | 6 +++--- config/locales/en.yml | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/deliverables_controller.rb b/app/controllers/deliverables_controller.rb index e0a74de..70c0180 100644 --- a/app/controllers/deliverables_controller.rb +++ b/app/controllers/deliverables_controller.rb @@ -17,13 +17,13 @@ class DeliverablesController < InheritedResources::Base if params[:deliverable] && params[:deliverable][:type] && Deliverable.valid_types.include?(params[:deliverable][:type]) @deliverable.type = params[:deliverable][:type] end - create! { contract_url(@project, @contract) } + create!(:notice => l(:text_flash_deliverable_created, :name => @deliverable.title)) { contract_url(@project, @contract) } end def update @deliverable = begin_of_association_chain.deliverables.find_by_id(params[:id]) params[:deliverable] = params[:fixed_deliverable] || params[:hourly_deliverable] || params[:retainer_deliverable] - update! { contract_url(@project, @contract) } + update!(:notice => l(:text_flash_deliverable_updated, :name => @deliverable.title)) { contract_url(@project, @contract) } end def show @@ -36,7 +36,7 @@ class DeliverablesController < InheritedResources::Base end def destroy - destroy! { contract_url(@project, @contract) } + destroy!(:notice => l(:text_flash_deliverable_destroyed, :name => resource.title)) { contract_url(@project, @contract) } end protected diff --git a/config/locales/en.yml b/config/locales/en.yml index 7a82241..e12914d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -67,3 +67,7 @@ en: text_changed_period_message: "The period for this deliverable has been changed. Would you like to expand/shrink the Deliverable Finances?" field_current_period: "Current period" text_retainer_monthly_message: "For a single month" + text_flash_deliverable_created: "Deliverable: {{name}} was successfully created." + text_flash_deliverable_updated: "Deliverable: {{name}} was successfully updated." + text_flash_deliverable_destroyed: "Deliverable: {{name}} was successfully destroyed." +