1
我爲formtastic製作了一個自定義的輸入法,它被設計爲與carrierwave一起工作,並且效果很好,但有一個例外,預覽圖像和其他html不會呈現,因爲它正在被消毒(我認爲)。cutsom formtastic的輸入,我做錯了什麼?
我是否完全錯誤的方式?
下面是代碼:
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
描繪的圖像和
標籤時逃走了。
我該如何解決這個問題。
非常感謝
不幸的是不是rails 3,而是2.3.8 – nodrog 2010-08-29 19:04:34