Module: UsersHelper

Defined in:
app/helpers/users_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) facebook_path(person)



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

def facebook_path(person)
  return "http#{$1}://www.facebook.com/#{$2}" if person.facebook =~ /\[http\]?(s)?:\/\/\]?\[www\.\]?facebook\.com\/(.*)\/?/
  return "http://www.facebook.com/#{person.facebook}"
end

- (Object) github_path(person)



27
28
29
30
# File 'app/helpers/users_helper.rb', line 27

def github_path(person)
  return "http#{$1}://www.github.com/#{$2}" if person.github =~ /\[http\]?(s)?:\/\/\]?\[www\.\]?github\.com\/(.*)\/?/
  return "http://www.github.com/#{person.github}"
end

- (Object) google_plus_path(person)



23
24
25
26
# File 'app/helpers/users_helper.rb', line 23

def google_plus_path(person)
  return "http#{$1}://plus.google.com/#{$2}" if person.google_plus =~ /[http]?(s)?:\/\/plus.google.com\/(\d+)[\/posts]?/
  return "http://plus.google.com/#{person.google_plus}"
end

- (Object) linked_in_path(person)

def twiki_user_link(twiki_username, human_name)

if twiki_username.blank?
  "#{human_name}"
else
  "<a href='http://whiteboard.sv.cmu.edu/people/#{twiki_username}' target='_top'>#{human_name}</a>".html_safe
end

end



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

def linked_in_path(person)
  return "http#{$1}://www.linkedin.com/in/#{$2}" if person.linked_in =~ /\[http\]?(s)?:\/\/\]?\[www\.\]?linkedin\.com\/in\/(.*)\/?/
  return "http://www.linkedin.com/in/#{person.linked_in}"
end

- (Object) twitter_path(person)



19
20
21
22
# File 'app/helpers/users_helper.rb', line 19

def twitter_path(person)
  return "http#{$1}://www.twitter.com/#{$2}" if person.twitter =~ /\[http\]?(s)?:\/\/\]?\[www\.\]?twitter\.com\/(.*)\/?/
  return "http://www.twitter.com/#{person.twitter}"
end