【发布时间】:2012-05-18 19:09:56
【问题描述】:
典型模式:
out = ''.html_safe # or ActiveSupport::SafeBuffer.new
out << content_tag(...) if foo
out << 'hello, 1 < 2' # will be escaped properly
out << content_tag(...) if bar
out
这很好用。有没有比这更好/更短/更好的方法,特别是调用''.html_safe?
【问题讨论】: