foodsoft/app/helpers/messages_helper.rb

13 lines
405 B
Ruby
Raw Normal View History

module MessagesHelper
2009-01-15 20:10:50 +01:00
def format_subject(message, length)
if message.subject.length > length
subject = truncate(message.subject, :length => length)
body = ""
else
subject = message.subject
body = truncate(message.body, :length => length - subject.length)
end
"<b>#{link_to(h(subject), message)}</b> <span style='color:grey'>#{h(body)}</span>".html_safe
end
end