简体   繁体   English

如何通过“最佳位置”编辑进行内联编辑时删除html标签

[英]how to remove html tags while doing inline edit via 'Best in place' editing

Am doing an inline edit using 'best in place' gem. 我正在使用“最佳位置”宝石进行内联编辑。 Everything works fine but while edit with rich text document(when styles are applied) it is shows the same tags on the view page. 一切正常,但在使用富文本文档进行编辑时(应用样式时),它在视图页面上显示相同的标记。

I tried with :display_with => lambda { |v| v.html_safe } 我尝试过:display_with => lambda { |v| v.html_safe } :display_with => lambda { |v| v.html_safe } Almost works fine but edit area is not shows properly.Only a slight area will be shown because of the rich textbox usage.so any alternate instead of the above or any solution to existing.Thanks in advance :display_with => lambda { |v| v.html_safe }几乎正常工作,但编辑区域没有正确显示。由于富文本框的使用,只显示一个小区域。所以任何替代,而不是上述或现有的任何解决方案。提前谢谢

<td class= "index_view ipad_index_view">
    <%= best_in_place_if can?(:edit_goals),goal,:description,url: admin_goal_path(goal,:page => "inline"),:display_with => lambda { |v| v.html_safe } %>
</td>   

Editing area is the entire area where the text with the alignment and styles given. 编辑区域是给定对齐和样式的文本的整个区域。 Currently if normal edit done w/o using rich textfield everything works fine but while done with rich text box only at the beginning the edit area appears. 目前,如果使用富文本字段进行正常编辑,则一切正常,但仅在开始时使用富文本框完成编辑区域。 The result is correct but the view is wrong 结果是正确的,但视图是错误的

try using raw tag. 尝试使用raw标签。 something like <%= raw @post.body %> in your block. 您的块中的<%= raw @post.body %>类的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用JQuery进行内联页面编辑(就地编辑)时如何维护安全性 - How to maintain security when using JQuery for inline page editing (edit-in-place) 如何添加双击进行编辑(内联编辑) - How to add a double click to edit (inline editing) 在Kendo网格中,如何在进行内联编辑时禁用拖动? - In a Kendo Grid, how I do disable dragging while doing an inline edit? 我们可以在进行内联编辑时延迟加载下拉数据吗? - Can we lazy load data for dropdown while doing inline edit? HTML表的内联编辑 - Inline editing for HTML table 如何在javascript字符串中放置html标签? - How to place html tags inside javascript string? jqGrid中的内联编辑添加按钮不起作用。 在按下添加时,它会在控制器中调用edit.do url - inline editing in jqGrid add button not working. while pressing add it calls edit.do url in controller 进行内联编辑时,如何在数据表中显示带有值的下拉列表? - How to display dropdown list with values in the datatable while performing inline editing? 如何编辑字符串中的字符,并删除编辑条件适用的字符 - How to edit a characters in a string, and remove characters that editing conditions apply to 如何在 textarea 中编辑带有标签的 HTML 文档而不显示标签? - How to edit HTML document with tags in textarea without displaying the tags?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM