Sha256: 9886d4ce84d1f3de1999857c95b35ad90e0e069339365af20be10a00bdaf20d3

Contents?: true

Size: 592 Bytes

Versions: 15

Compression:

Stored size: 592 Bytes

Contents

class StatesController < Spree::BaseController
  resource_controller

  ssl_allowed :index
  
  index.response do |wants|
    wants.html
    wants.js do
      # 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] = []}
      State.find(:all, :order => "name ASC").each{|state|
        @state_info[state.country_id.to_s].push [state.id, state.name]
      }
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-0.11.4 app/controllers/states_controller.rb
spree-0.11.3 app/controllers/states_controller.rb
spree-0.11.2 app/controllers/states_controller.rb
spree-0.11.1 app/controllers/states_controller.rb
spree-0.11.0 app/controllers/states_controller.rb
spree-0.10.2 app/controllers/states_controller.rb
spree-0.10.1 app/controllers/states_controller.rb
spree-0.10.0 app/controllers/states_controller.rb
spree-0.10.0.beta app/controllers/states_controller.rb
spree-enriquez-0.9.4 app/controllers/states_controller.rb
spree-0.9.4 app/controllers/states_controller.rb
spree-0.9.3 app/controllers/states_controller.rb
spree-0.9.2 app/controllers/states_controller.rb
spree-0.9.1 app/controllers/states_controller.rb
spree-0.9.0 app/controllers/states_controller.rb