Commit 3f4accc9

mo khan <mo@mokhan.ca>
2014-06-01 21:16:59
display geocoder search results for photo.
1 parent 53838b9
Changed files (2)
app
controllers
views
admin
app/controllers/admin/photos_controller.rb
@@ -11,6 +11,7 @@ module Admin
 
     def show
       @photo = @photo_repository.find(params[:id])
+      @results = Geocoder.search("#{@photo.latitude},#{@photo.longitude}")
     end
   end
 end
app/views/admin/photos/show.html.erb
@@ -31,5 +31,10 @@
 
     <h2><%= @photo.image.root %><%= @photo.image.url %></h2>
     <%= image_tag @photo.image.url %>
+    <ul>
+    <% @results.each do |result| %>
+      <li><%= result.formatted_address %></li>
+    <% end %>
+    </ul>
   </div>
 </div>