Module: Crm::PostCommentsHelper

Defined in:
app/helpers/crm/post_comments_helper.rb

Instance Method Summary collapse

Instance Method Details

#post_comment_commands(post_comment) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/crm/post_comments_helper.rb', line 3

def post_comment_commands(post_comment)
  cmds = []
  # only allow one level of response
  unless post_comment.parent_comment_id
    cmds << link_to('Respond', new_post_post_comment_path(post_comment.post_id, parent_id: post_comment.id))
  end
  cmds << link_to('Edit', edit_post_comment_path(post_comment.id))
  cmds += available_events_links(post_comment, return_path: post_post_comments_path(post_comment.post_id))
  cmds << link_to('View on www', post_url(post_comment.post_id, host: WEB_HOSTNAME))
  cmds << link_to('Delete', post_comment_path(post_comment.id), data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to destroy the post comment: #{post_comment.body}" })
  cmds
end