Module: PostsHelper

Defined in:
app/helpers/posts_helper.rb

Instance Method Summary collapse

Instance Method Details

#sharethis_options(post) ⇒ Object

The ShareThis widget defines a bunch of attributes you can customize. Facebook seems to ignore them (it uses title and description meta tags instead). MySpace, however, only works if you set these attributes.


6
7
8
9
10
11
12
13
# File 'app/helpers/posts_helper.rb', line 6

def sharethis_options(post)
   :script, :type=>"text/javascript" do
      "SHARETHIS.addEntry({
        title:'#{escape_javascript(post.title)}',
        content:'#{escape_javascript(truncate_words(post.post, 75, '...' ))}'
      }, {button:true});".html_safe
  end
end