Templates: added m helper
This commit is contained in:
@ -54,6 +54,15 @@ module ApplicationHelper
|
||||
html.html_safe
|
||||
end
|
||||
|
||||
# Use as <%= markdown content %> or <%= m content %>
|
||||
# Content can be nil, in that case
|
||||
# it will be the same as an empty string.
|
||||
def markdown(content)
|
||||
RDiscount.new(content || ''.freeze).to_html.html_safe
|
||||
end
|
||||
|
||||
alias m markdown
|
||||
|
||||
private
|
||||
|
||||
def locale_menu_item(locale)
|
||||
|
||||
@ -5,6 +5,5 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<%# TODO: create a helper 'm' like 'j', so this is just <%= m @document.content %>
|
||||
<%= RDiscount.new(@document.content).to_html.html_safe %>
|
||||
<%= m @document.content %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user