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

13 lines
325 B
Ruby
Raw Normal View History

class AddressesController < ApplicationController
respond_to :json
2011-03-27 18:45:58 +00:00
def show
@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