Class: CityPicker::DataController

Inherits:
ApplicationController show all
Defined in:
app/controllers/city_picker/data_controller.rb

Instance Method Summary collapse

Instance Method Details

#listObject



3
4
5
6
7
8
9
10
# File 'app/controllers/city_picker/data_controller.rb', line 3

def list
  type = params[:city_type] || 'province'
  code = params[:code] || '11'
  data = CityPicker::list(type, code)
  code = 0
  code = 1 if data.blank?
  render json: {code: code, data: data}
end