diff options
-rw-r--r-- | app/helpers/twitter_helper.rb | 5 | ||||
-rw-r--r-- | app/views/twitter/_index.html.erb | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/twitter_helper.rb b/app/helpers/twitter_helper.rb index 9fd4ffd..b01293f 100644 --- a/app/helpers/twitter_helper.rb +++ b/app/helpers/twitter_helper.rb @@ -1,4 +1,7 @@ module TwitterHelper + def twitter_enabled + Rails.application.secrets.twitter['enabled'] == true + end def twitter_client Twitter::REST::Client.new do |config| @@ -20,5 +23,3 @@ module TwitterHelper twitter_client.user_timeline(twitter_handle).select{ |tweet| tweet.text.start_with?('RT','@')==false} end end - -# unless Rails.application.secrets.twitter['enabled'] == false diff --git a/app/views/twitter/_index.html.erb b/app/views/twitter/_index.html.erb index 3dab567..8ac65be 100644 --- a/app/views/twitter/_index.html.erb +++ b/app/views/twitter/_index.html.erb @@ -1,3 +1,4 @@ +<% if twitter_enabled == true %> <div class="twitter"> <div class="twitter_header"> Tweets by <%= twitter_name %></p> @@ -22,3 +23,4 @@ To prevent leakage no links are displayed. For more information visit @<%= twitter_name %> on twitter.com.</p> </div> </div> +<% end %> |