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
14
15
# File 'app/helpers/posts_helper.rb', line 6

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