]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entries_controller.rb
Set Open Graph image to first image for diary entries
[rails.git] / app / controllers / diary_entries_controller.rb
index 9af36709eb20be1a2055a964daf2697d3443af1f..f3fbcd1fd0193aed5b70015f24490e0b2a7176bd 100644 (file)
@@ -68,6 +68,7 @@ class DiaryEntriesController < ApplicationController
     @entry = entries.find_by(:id => params[:id])
     if @entry
       @title = t ".title", :user => params[:display_name], :title => @entry.title
+      @og_image = @entry.body.image
       @comments = can?(:unhidecomment, DiaryEntry) ? @entry.comments : @entry.visible_comments
     else
       @title = t "diary_entries.no_such_entry.title", :id => params[:id]