使用formtastic启用rails表单上的html

使用formtastic启用rails表单上的html,html,ruby-on-rails,ruby,formtastic,Html,Ruby On Rails,Ruby,Formtastic,我想在我的表单上启用用户的html输入 已尝试:=f.input:body,:input\u html=>{:escape=>false}和{:disabled=>false} 现在文本显示为块 如果用户输入: Lorem Ipsum is simply dummy text `</br>` of the printing and typesetting industry. 非常感谢你的帮助 解决了它 表格f.text_区域 在模型上添加方法 def body_enable_htm

我想在我的表单上启用用户的html输入

已尝试:=f.input:body,:input\u html=>{:escape=>false}和{:disabled=>false}

现在文本显示为块

如果用户输入:

Lorem Ipsum is simply dummy text `</br>` of the printing and typesetting industry.
非常感谢你的帮助

解决了它

表格f.text_区域

在模型上添加方法

def body_enable_html
  body.html_safe
end
并在视图中调用方法

= @collection_page.body_enable_html
= @collection_page.body_enable_html