简体   繁体   中英

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 } 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

<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. something like <%= raw @post.body %> in your block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM