Sha256: b2145da83a42929255fce0ab42f94e9fdde9ebd15991baef682bee5fce325e7f

Contents?: true

Size: 625 Bytes

Versions: 47

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Admin
    class ZonesController < ResourceController
      before_action :load_data, except: :index

      def new
        @zone.zone_members.build
      end

      private

      def collection
        params[:q] ||= {}
        params[:q][:s] ||= "name asc"
        @search = super.ransack(params[:q])
        @zones = @search.result.page(params[:page]).per(params[:per_page])
      end

      def load_data
        @countries = Spree::Country.order(:name)
        @states = Spree::State.order(:name)
        @zones = Spree::Zone.order(:name)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
solidus_backend-2.10.5 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.10.3 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.10.2 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.6 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.8.6 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.10.1 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.5 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.10.0 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.4 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.6.6 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.7.4 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.8.5 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.3 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.2 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.10.0.beta1 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.7.3 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.6.5 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.1 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.0 app/controllers/spree/admin/zones_controller.rb
solidus_backend-2.9.0.rc.1 app/controllers/spree/admin/zones_controller.rb