Created
August 19, 2016 00:41
-
-
Save drkpkg/8ba7a2228264b81bd7714a0f9913e4e3 to your computer and use it in GitHub Desktop.
Ejemplo de como hacer consultas Json por paises, ciudades y estados.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def countries | |
#Obtiene todos los países para ser listados | |
render json: CS.countries | |
end | |
def cities | |
#Obtiene las ciudades por un estado y un país | |
render json: CS.cities(params[:state], params[:country]) | |
end | |
def states | |
#Obtiene los estados dependiendo del país | |
render json: CS.states(params[:country]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment