mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
Use Spree.t directly for translating the successfully_removed flash message
Since none of the current keys have a `%{resource}` parameter.
This commit is contained in:
@@ -61,7 +61,7 @@ module Admin
|
||||
|
||||
def destroy
|
||||
if @object.destroy
|
||||
flash[:success] = flash_message_for(@object, :successfully_removed)
|
||||
flash[:success] = Spree.t(:successfully_removed)
|
||||
respond_with(@object) do |format|
|
||||
format.html { redirect_to collection_url }
|
||||
format.js { render partial: "spree/admin/shared/destroy" }
|
||||
|
||||
@@ -68,7 +68,7 @@ module Spree
|
||||
destroy_before
|
||||
|
||||
if @object.destroy
|
||||
flash[:success] = flash_message_for(@object, :successfully_removed)
|
||||
flash[:success] = Spree.t(:successfully_removed)
|
||||
end
|
||||
|
||||
redirect_to location_after_save
|
||||
|
||||
@@ -16,7 +16,7 @@ module Spree
|
||||
@url_filters = ::ProductFilters.new.extract(request.query_parameters)
|
||||
|
||||
if @object.destroy
|
||||
flash[:success] = flash_message_for(@object, :successfully_removed)
|
||||
flash[:success] = Spree.t(:successfully_removed)
|
||||
end
|
||||
# if destroy fails it won't show any errors to the user
|
||||
redirect_to spree.admin_product_product_properties_url(params[:product_id], @url_filters)
|
||||
|
||||
@@ -36,7 +36,7 @@ module Spree
|
||||
end
|
||||
|
||||
@object.touch :deleted_at
|
||||
flash[:success] = flash_message_for(@object, :successfully_removed)
|
||||
flash[:success] = Spree.t(:successfully_removed)
|
||||
|
||||
respond_with(@object) do |format|
|
||||
format.html { redirect_to collection_url }
|
||||
|
||||
@@ -5,7 +5,7 @@ module Spree
|
||||
class TaxCategoriesController < ::Admin::ResourceController
|
||||
def destroy
|
||||
if @object.destroy
|
||||
flash[:success] = flash_message_for(@object, :successfully_removed)
|
||||
flash[:success] = Spree.t(:successfully_removed)
|
||||
respond_with(@object) do |format|
|
||||
format.html { redirect_to collection_url }
|
||||
format.js { render partial: "spree/admin/shared/destroy" }
|
||||
|
||||
Reference in New Issue
Block a user