title: Find coordinates for my database's address column
body: <p>I have my own database that includes: <code>address</code>, <code>lat</code>, <code>long</code>, <code>name</code>.
  I have all the addresses that I want without their coordinates. Is there a way to find the coordinates in order to use them as markers on my active map?</p>
  
  <p>In other words I want something to batch?! geocode my addresses that are already in to my database.</p>
  
  <p>Thank you very much</p>
  
  <p><strong>Edited:</strong></p>
  
  <pre><code>def index
  if params[:search].present?
    @locations = Location.near(params[:search], 20, :order =&gt; :distance)
  else
    @locations = Location.all
    @locations.each do |l|
      if l.latitude.nil?
        new_location = "#{l.address}"
        s = Geocoder.search(new_location)
        l.latitude = s[0].latitude
        l.longitude = s[0].longitude
        l.save
      end
    end
  end
  </code></pre>
  
  <p>This is what I have, but it updates only my first address on the database. </p>