Sha256: 5a557c5c0ed8a0713c773090436a848472264b492691721dcd3054e7cb9007dd

Contents?: true

Size: 528 Bytes

Versions: 11

Compression:

Stored size: 528 Bytes

Contents

module Spree
  class StatesController < BaseController
    ssl_allowed :index

    def index
      # table of {country.id => [ state.id , state.name ]}, arrays sorted by name
      # blank is added elsewhere, if needed
      # we return ALL known information, since billing country isn't restricted
      #   by shipping country
      @state_info = Hash.new { |h, k| h[k] = [] }
      Spree::State.order('name ASC').each { |state|
        @state_info[state.country_id.to_s].push [state.id, state.name]
      }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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