一千萬個為什麽

搜索

WYSIWYG在視圖中顯示為HTML - Ruby on Rails

我在我的rails應用程序中有兩個單獨的WYSWYG編輯器這個問題所以我認為這與修改字段顯示的方式有關。

In my Post table the field I am attempting to affect is called body. When I use the WYSIWYG editor and save it, the display from the both the index and the show views actually shows the HTML. For instance, if I make something bold in the WYSISWG editor, it will output in the view something and the associated

show, etc.

有一個簡單的解決方案,我錯過了嗎?

最佳答案

您使用哪個rails版本?

Perhaps you use h method in views so all your html tags are escaped or you are escaping your tags in controller while saving post

轉載註明原文: WYSIWYG在視圖中顯示為HTML - Ruby on Rails