Sha256: 81f97e4d55d62e439bcb2725437f7e0f4cd8b3fe2d51633112055842b57fab44

Contents?: true

Size: 703 Bytes

Versions: 5

Compression:

Stored size: 703 Bytes

Contents

module Spree
  module Admin
    module ProductPropertiesControllerDecorator
      def translate
        product_property = Spree::ProductProperty.find(params[:id])
        product_property.update update_product_property_attribute
        redirect_to spree.admin_product_product_properties_path(product_property.product)
      end

      private
      def update_product_property_attribute
        params.require(:product_property).permit(permitted_params)
      end

      def permitted_params
      [translations_attributes: [:id, :locale, :value]]
      end
    end
  end
end

SpreeMobility.prepend_once(::Spree::Admin::ProductPropertiesController, Spree::Admin::ProductPropertiesControllerDecorator)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_mobility-1.4.0 app/controllers/spree/admin/product_properties_controller_decorator.rb
spree_mobility-1.3.0 app/controllers/spree/admin/product_properties_controller_decorator.rb
spree_mobility-1.2.0 app/controllers/spree/admin/product_properties_controller_decorator.rb
spree_mobility-1.1.0 app/controllers/spree/admin/product_properties_controller_decorator.rb
spree_mobility-1.0.0 app/controllers/spree/admin/product_properties_controller_decorator.rb