【发布时间】:2010-08-27 13:27:54
【问题描述】:
我已经为 formtastic 制作了一个自定义输入法,它被设计为与carrierwave一起使用并且效果很好,但除了一个例外,预览图像和其他html将不会呈现,因为它正在被清理(我认为)。
我是不是走错了路?
代码如下:
def carrierwave_input(method, options)
c = basic_input_helper(:file_field, :string, method, options)
c += hidden_input((method.to_s+"_cache").to_sym, {})
if object.send("#{method.to_s}?")
c += %{<img src="#{object.send("#{method.to_s}_url")}">}
c += "<br>"
c += boolean_input(("remove_"+method.to_s).to_sym, {})
end
return c
结束
调用:
form.input :thumb, :as => :carrierwave
渲染图像时,
标签转义。
我怎样才能解决这个问题。
非常感谢
【问题讨论】: