From 77a804f925b92b3a4998ba6dce8283154b7abdc9 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 3 Jul 2015 19:53:24 +0800 Subject: [PATCH] small change for facebook meta tags --- app/controllers/announcements_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 2bee4f3..9d41c8b 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -135,6 +135,11 @@ class AnnouncementsController < ApplicationController update_user = announcement.update_user.member_profile.name rescue "" desc = announcement.image_description desc = (desc.nil? || desc == "" ? "announcement image" : desc) + + request = OrbitHelper.request + meta_desc = announcement.subtitle.nil? || announcement.subtitle == "" ? announcement.text[0..200] : announcement.subtitle + OrbitHelper.render_meta_tags([{"property" => "og:title", "content" => announcement.title},{"property" => "og:site_name", "content" => Site.first.title},{"property" => "og:url", "content" => request.original_url},{"property" => "og:description", "content" => meta_desc},{"property" => "og:image", "content" => "#{request.base_url}#{announcement.image.url}"},{"property" => "og:type", "content" => "Article"}]) + { "tags" => tags, "bulletin_files" => files,