Guys,

I have a Customer class which creates an instance of an Address class,
and the user can then go into the show method of the Customer class
and associate other addresses with that Customer (sites).  As soon as
an Address instance is created, I want to call geocoding to get the
latitude and longitude of that address so that I can later render a
map of all the sites.  now, I suspect that a call to the geocoding url
synchronously would be a bad thing:

def create
  @address = Address.new(params[:address])
  ... assign other @address parameters
  ...
  create a geocoding instance
  call geocoding, passing in address string, getting back a lat and a
long  <--- wait wait wait wait
  @address.latitude = lat; @address.long = long
end

What's the best practice for doing something like this in ruby/rails?

TIA,

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to