adopt-a-hydrant/app/controllers/addresses_controller.rb

12 lines
325 B
Ruby
Raw Normal View History

class AddressesController < ApplicationController
respond_to :json
def index
@address = Address.find_lat_lng("#{params[:address]}, #{params[:city_state]}")
unless @address.blank?
respond_with @address
else
render :json => {"errors" => {"address" => ["Could not find address."]}}
end
end
end