Module: Blogit::CommentsHelper

Defined in:
app/helpers/blogit/comments_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) name_for_comment(comment)

The commenter's name for a Comment. When the Comment has a website, includes an html link containing their name. Otherwise, just shows the name as a String.

Parameters:

Returns:

  • a String containing the commenter's name.


11
12
13
14
15
16
17
# File 'app/helpers/blogit/comments_helper.rb', line 11

def name_for_comment(comment)
  if comment.website?
    link_to(comment.name, comment.website, class: "blogit_comment__name_link")
  else
    comment.name
  end + " " + t('wrote', scope: "blogit.comments")
end