Sha256: 744b068175326f50a62f350714d758648fe1e880fa7d68a69b4589798c52dc88

Contents?: true

Size: 819 Bytes

Versions: 14

Compression:

Stored size: 819 Bytes

Contents

module Spree
  module Admin
    class ShippingMethodsController < ResourceController
      before_filter :load_data, :except => [:index]
      before_filter :set_shipping_category, :only => [:create, :update]

      private

      def set_shipping_category
        return true if params[:shipping_method][:shipping_category_id] == ""
        @shipping_method.shipping_category = Spree::ShippingCategory.find(params[:shipping_method][:shipping_category_id])
        @shipping_method.save
        params[:shipping_method].delete(:shipping_category_id)
      end

      def location_after_save
        edit_admin_shipping_method_path(@shipping_method)
      end

      def load_data
        @available_zones = Zone.order(:name)
        @calculators = ShippingMethod.calculators.sort_by(&:name)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
spree_core-1.0.7 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.6 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.1.1 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.1.0 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.4 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.1.0.rc2 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.1.0.rc1 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.3 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.2 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.1 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.0 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.0.rc4 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.0.rc3 app/controllers/spree/admin/shipping_methods_controller.rb
spree_core-1.0.0.rc2 app/controllers/spree/admin/shipping_methods_controller.rb