Created
March 13, 2015 18:45
-
-
Save breim/7733f703a95233efae76 to your computer and use it in GitHub Desktop.
Controler busca CEP
This file contains hidden or 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
# Tu vai ter que configurar uma route para chamar aqui, que vai ser o mesmo link que está setado no javascript no arquivo anterior | |
def busca_por_cep | |
render :json => BuscaEndereco.cep(params[:cep]) | |
rescue RuntimeError | |
render :json => ["", "zipcode nao encontrado", "", "", ""].to_json | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment