module Chatroom module MessageHelper def new_communication(msg=nil) "
:#{msg.try(:send_time)}
#{sanitize(msg.try(:html_content), tags: %w(br img span p i b a), attributes: %w(id class style))}
" end # Show all the communications in chatroom def show_communications(msgs=nil) msgs ||= [] messages = msgs.collect do |msg| "
:#{msg.try(:send_time)}
#{sanitize(msg.try(:html_content), tags: %w(br img span p i b a), attributes: %w(id class style))}
" end messages.join('') end end end