Sha256: 3c13af603e77a003c62ab15960eb08f9cc5a35915f604371c1710e32c039a613

Contents?: true

Size: 652 Bytes

Versions: 1

Compression:

Stored size: 652 Bytes

Contents

module Spree
  module Admin
    class ShipCompliantSettingsController < Spree::Admin::BaseController
      before_action :load_config

      def edit
        @preferences_ship_compliant = [:username, :password, :partner_key, :service_url]
      end

      def update
        params.each do |name, value|
          next unless @config.has_preference? name
          @config[name] = value
        end

        flash[:success] = Spree.t(:ship_compliant_settings_updated)
        redirect_to edit_admin_ship_compliant_settings_path
      end

      private

      def load_config
        @config ||= SolidusShipCompliant::Config
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_ship_compliant-1.0.0 app/controllers/spree/admin/ship_compliant_settings_controller.rb