Change for getting url from key

This commit is contained in:
Christophe Vilayphiou committed 2012-08-08 07:46:10 +08:00
1 parent f7e6703d5f
commit db16fdc7b5
5 files changed
+8 -7

No files matched your search

+2 -2
View File
@@ -215,13 +215,13 @@ module ApplicationHelper
object.strftime("%Y-%m-%d")
end
def share_links(object)
def share_links(object, key)
js = ''
js << "<meta property='og:title' content='#{object.title}' />\n" rescue ''
js << "<meta property='og:description' content='#{object.subtitle}' />\n" rescue ''
js << "<meta property='og:image' content='#{object.image.url}' />\n" rescue ''
content_tag :div, :class => 'fb' do
concat social_share_button_tag(object.title, :fb_url => "http://#{request.env['HTTP_HOST']}/share/#{object.class.to_s.underscore}/#{object.id}", :image => "http://#{request.env['HTTP_HOST']}#{object.image.url}")
concat social_share_button_tag(object.title, :fb_url => "http://#{request.env['HTTP_HOST']}/share/#{object.class.to_s.underscore}/#{object.id}?key=#{key}", :image => "http://#{request.env['HTTP_HOST']}#{object.image.url}")
# concat javascript_tag "$('head').append('#{j js}');"
end
end