Class: TbCommerce::Api::StatesController
- Inherits:
-
BaseController
- Object
- Spud::ApplicationController
- TbCommerce::ApplicationController
- BaseController
- TbCommerce::Api::StatesController
- Defined in:
- app/controllers/tb_commerce/api/states_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/tb_commerce/api/states_controller.rb', line 3 def index country = Country[params.require(:country)] if country.blank? raise Spud::NotFoundError.new(:item => 'country') end @states = country.states expires_in 1.day, :public => true render 'index' end |