Module: CommentsHelper

Defined in:
app/helpers/comments_helper.rb

Overview

Helper methods for handling comments

Instance Method Summary collapse

Instance Method Details

Parameters:

  • entity (Comment)
  • text (String) (defaults to: entity.text_for_link)
  • options (Hash) (defaults to: {})


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

def admin_comment_link(entity, text = entity.text_for_link, options = {})
  link_to(text, admin_comment_path(id: entity.id), options)
end

Parameters:

  • entity (Comment)
  • text (String) (defaults to: entity.commentable_name)
  • options (Hash) (defaults to: {})


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

def comment_link(entity, text = entity.commentable_name, options = {})
  anchor = options.key?(:anchor)
  options.delete(:anchor)
  link_to(text, CommentsManager.commentable_path(entity, anchor), options)
end