diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6d5b896f..e74e5976 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -222,11 +222,15 @@ module ApplicationHelper js << "\n" rescue '' js << "\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}?key=#{key}", :image => "http://#{request.env['HTTP_HOST']}#{object.image.url}") + concat social_share_button_tag(object.title, :fb_url => generate_fb_url(object,key), :image => "http://#{request.env['HTTP_HOST']}#{object.image.url}") # concat javascript_tag "$('head').append('#{j js}');" end end + def generate_fb_url(object,key) + "http://#{request.env['HTTP_HOST']}/share/#{object.class.to_s.underscore}/#{object.id}?key=#{key}" + end + def wrap_string_with(str,options={}) line_width = options[:line_width] || 12 wrap_mark = options[:wrap_mark] || "
"