Sha256: 71088f5d26aaaf1aa36bf32213c17b9fddf49a184b6f0b8d5f1217097ad89fe7
Contents?: true
Size: 498 Bytes
Versions: 4
Compression:
Stored size: 498 Bytes
Contents
class StatesController < Spree::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] = []} State.find(:all, :order => "name ASC").each{|state| @state_info[state.country_id.to_s].push [state.id, state.name] } end end
Version data entries
4 entries across 4 versions & 1 rubygems