feat(messages): render markdown in message body
uses redcarpet gem to render markdown to html. Also a html email template is added.
This commit is contained in:
parent
fb8ccfea4a
commit
d2d7d0c4f9
5 changed files with 19 additions and 3 deletions
|
|
@ -132,9 +132,14 @@ class Message < ApplicationRecord
|
|||
user.role_admin?
|
||||
end
|
||||
|
||||
def render_markdown
|
||||
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true, strikethrough: true, footnotes: true)
|
||||
return markdown.render(body)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_salt
|
||||
self.salt = [Array.new(6) { rand(256).chr }.join].pack("m").chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue