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

13 lines
349 B
Ruby
Raw Normal View History

class AddressesController < ApplicationController
2011-05-06 02:38:25 +00:00
respond_to :json
2011-03-27 18:45:58 +00:00
def show
@address = Address.geocode("#{params[:address]}, #{params[:city_state]}")
unless @address.blank?
2011-05-06 02:38:25 +00:00
respond_with @address
else
2014-03-25 09:47:44 +00:00
render(json: {errors: {address: [t("errors.not_found", thing: t("defaults.address"))]}}, status: 404)
end
end
end