From 4276840113c5964b6da9bf9d9de2c1e422a4616d Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 3 Jul 2015 20:55:23 +0800 Subject: [PATCH] page share for fb --- app/controllers/news_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 7478114..5cab1af 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -195,6 +195,10 @@ class NewsController < ApplicationController links = news.news_bulletin_links.collect{|link| { "link_url" => link.url, "link_title" => (link.title.blank? ? link.url : link.title) } } rescue [] update_user = news.update_user.member_profile.name rescue "" department = news.department rescue "" + + request = OrbitHelper.request + meta_desc = news.subtitle.nil? || news.subtitle == "" ? news.text[0..200] : news.subtitle + OrbitHelper.render_meta_tags([{"property" => "og:title", "content" => news.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}#{news.image.url}"},{"property" => "og:type", "content" => "Article"}]) { "tags" => tags, "news_bulletin_files" => files,