4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/spree/admin/payment_method_translations_controller.rb', line 4
def translate
payment_method = Spree::PaymentMethod.find(params[:id])
translations_params =
params.require(:payment_method).permit(
[translations_attributes: [:id, :locale, :name, :description]])
payment_method.translations.delete_all
translations_params[:translations_attributes].each_pair do |k, value|
payment_method.translations.create(value)
end
flash[:success] = Spree.t(:successfully_updated, resource: Spree.t(:payment_method))
redirect_to spree.edit_admin_payment_method_path(payment_method)
end
|