Properly indent whole multiline comment in email notification

openid
Marcin Kulik 12 years ago
parent 03e0c59e37
commit 02960a0cdc

@ -21,4 +21,8 @@ module ApplicationHelper
text = capture(&block)
MKD_RENDERER.render(capture(&block)).html_safe
end
def indented(string, width)
string.lines.map { |l| "#{' ' * width}#{l}" }.join('')
end
end

@ -1,5 +1,6 @@
class UserMailer < ActionMailer::Base
default :from => "ascii.io <hello@ascii.io>"
helper :application
def new_comment_email(user, comment)
@comment = comment

@ -2,7 +2,7 @@ Howdy!
~<%= @author.nickname %> (<%= profile_url(@author) %>) commented on your asciicast "<%= @asciicast.smart_title %>":
<%= @comment.body %>
<%= indented @comment.body, 4 %>
---
http://ascii.io/

Loading…
Cancel
Save