Module: Refinery::Tweets::TweetsHelper

Defined in:
app/helpers/refinery/tweets/tweets_helper.rb

Instance Method Summary collapse

Instance Method Details

#refinery_tweets_url_for_accountObject



35
36
37
# File 'app/helpers/refinery/tweets/tweets_helper.rb', line 35

def 
  "https://twitter.com/#{account_settings["username"]}"
end

#tweets(options = {}) ⇒ Object

Twitter widget is enabled by default It can be disabled in the initializer config/initializers/refinery/tweets.rb

The user will require a widget_id If there is no widget id or the widget is disabled in the config a simple js implementation using the public API is used



14
15
16
17
18
19
20
21
# File 'app/helpers/refinery/tweets/tweets_helper.rb', line 14

def tweets(options={})
  return unless  && ["visible"] == true
  if can_use_twitter_widget?
    twitter_widget(options)
  elsif can_use_jquery_tweet_list?
    tweet_list(options)
  end
end


27
28
29
# File 'app/helpers/refinery/tweets/tweets_helper.rb', line 27

def 
  link_to twitter_handle, 
end

#tweets_headerObject



23
24
25
# File 'app/helpers/refinery/tweets/tweets_helper.rb', line 23

def tweets_header
   + " on Twitter"
end

#twitter_handleObject



31
32
33
# File 'app/helpers/refinery/tweets/tweets_helper.rb', line 31

def twitter_handle
  "@" + ["username"]
end