Module: ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#calculate_class(*arr) ⇒ Object



3
4
5
# File 'app/helpers/application_helper.rb', line 3

def calculate_class(*arr)
  arr.any? {|x| current_page?("/#{x}") } ? 'active' : ''
end

#decorated_username(infraction) ⇒ Object



7
8
9
10
# File 'app/helpers/application_helper.rb', line 7

def decorated_username(infraction)
  username = infraction.username
  "<a href='https://twitter.com/#{username}' target='_blank'>@#{username}</a>"
end

#screen_nameObject



12
13
14
# File 'app/helpers/application_helper.rb', line 12

def screen_name
  "@#{TwitterService.instance.screen_name}"
end

#screen_name_hashtagObject



16
17
18
# File 'app/helpers/application_helper.rb', line 16

def screen_name_hashtag
  "##{TwitterService.instance.screen_name}"
end