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