Class: TbCommerce::Api::StatesController

Inherits:
BaseController show all
Defined in:
app/controllers/tb_commerce/api/states_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



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