title: Ordering posts by distance to city using geocoder
body: <p>I am trying to order my posts by how close they are to the location of the current user using geocoder. 
  Here is the controller:</p>
  
  <pre><code>def top
  @city = request.location.city
  @closepost = Post.near(@city, order: :distance)
  end
  </code></pre>
  
  <p>and here is the view:</p>
  
  <pre><code>&lt;% @closepost.each do |post| %&gt;
   &lt;%= post.title %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code>undefined method `to_f' for {:order=&gt;:distance}:Hash
  </code></pre>