Module: NotifierHelper

Includes:
PostsHelper
Defined in:
app/helpers/notifier_helper.rb

Instance Method Summary collapse

Methods included from PostsHelper

#post_iframe_url, #post_page_title

Instance Method Details

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

Returns The formatted comment.

Parameters:

  • comment (Comment)

    The comment to process.

Returns:

  • (String)

    The formatted comment.


19
20
21
22
23
24
25
# File 'app/helpers/notifier_helper.rb', line 19

def comment_message(comment, opts={})
  if comment.post.public?
    comment.message.plain_text_without_markdown
  else
    I18n.translate "notifier.a_limited_post_comment"
  end
end

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

Returns The formatted post.

Parameters:

  • post (Post)

    The post object.

  • opts (Hash) (defaults to: {})

    Optional hash. Accepts :length parameters.

Returns:

  • (String)

    The formatted post.


9
10
11
12
13
14
15
# File 'app/helpers/notifier_helper.rb', line 9

def post_message(post, opts={})
  if post.respond_to? :message
    post.message.try(:plain_text_without_markdown).presence || post_page_title(post)
  else
    I18n.translate "notifier.a_post_you_shared"
  end
end