Module: NotifierHelper

Defined in:
app/helpers/notifier_helper.rb

Instance Method Summary collapse

Instance Method Details

#comment_message(comment, opts = {}) ⇒ String


17
18
19
# File 'app/helpers/notifier_helper.rb', line 17

def comment_message(comment, opts={})
  comment.message.plain_text_without_markdown truncate: opts.fetch(:length, 600)
end

#post_message(post, opts = {}) ⇒ String


6
7
8
9
10
11
12
# File 'app/helpers/notifier_helper.rb', line 6

def post_message(post, opts={})
  if post.respond_to? :message
    post.message.plain_text_without_markdown truncate: opts.fetch(:length, 200)
  else
    I18n.translate 'notifier.a_post_you_shared'
  end
end