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