Sha256: b6f59dca2dfff5c9d3028c1e67319cd57760db313eb48dd8c42eb0cbe727d72a

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 Bytes

Contents

# @author : Arvind Vyas
module CountryStateSelect
  class CscsController < ApplicationController
    def find_states
      csc = CS.states(params[:country_id])

      respond_to do |format|
        format.json { render json: csc.to_a }
      end
    end

    # Sent it to state_id and  country id it will return cities of that states
    def find_cities
      cities = CS.cities(params[:state_id].to_sym, params[:country_id].to_sym)

      respond_to do |format|
        format.json { render json: cities.to_a }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
country_state_select-3.0.5 app/controllers/country_state_select/cscs_controller.rb