Module: Collavre::CommentsHelper
- Defined in:
- app/helpers/collavre/comments_helper.rb
Instance Method Summary collapse
Instance Method Details
#comment_action_markdown(comment) ⇒ Object
9 10 11 12 13 14 |
# File 'app/helpers/collavre/comments_helper.rb', line 9 def comment_action_markdown(comment) parsed = JSON.parse(comment.action) parsed["markdown"] if parsed.is_a?(Hash) && parsed["markdown"].present? rescue JSON::ParserError, TypeError nil end |
#formatted_comment_action(comment) ⇒ Object
3 4 5 6 7 |
# File 'app/helpers/collavre/comments_helper.rb', line 3 def formatted_comment_action(comment) JSON.pretty_generate(JSON.parse(comment.action)) rescue JSON::ParserError, TypeError comment.action.to_s end |