Permalink
Browse files

Ensure that spree/states#index returns javascript response

  • Loading branch information...
1 parent 9a1234f commit 2ed646a821c7dd86ac1f4c4ab4190cc93b366663 @cyu cyu committed Mar 23, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/app/controllers/spree/states_controller.rb
@@ -2,6 +2,8 @@ module Spree
class StatesController < BaseController
ssl_allowed :index
+ respond_to :js
+
def index
# table of {country.id => [ state.id , state.name ]}, arrays sorted by name
# blank is added elsewhere, if needed
@@ -11,6 +13,8 @@ def index
Spree::State.order('name ASC').each { |state|
@state_info[state.country_id.to_s].push [state.id, state.name]
}
+
+ respond_with(@state_info)
end
end
end

0 comments on commit 2ed646a

Please sign in to comment.