1

我将 tinymce 添加到我的活动管理员中,这样我就可以格式化大文本区域。效果很好,我可以添加效果并保存该模型。但是当我去浏览器时,它只显示这样的 html 代码:

<p>Aizaugu&scaron;u &nbsp;lauksaimniecības zemju apstrāde ar Ahvi zemes frēzi.</p> <p><span style="color: #333333; font-family: 'Segoe UI', Arial, Verdana, Tahoma, sans-serif; font-size: 13px;"><strong>In Microsoft Office OneNote 2007</strong>, you try to send a note to a mail recipient as an attachment. After you do this, the following text is unexpectedly inserted in the body of a new e-mail message:</span></p> <div class="message" style="margin: 0px; padding: 10px 30px; color: #333333; font-family: 'Segoe UI', Arial, Verdana, Tahoma, sans-serif; font-size: 13px;"><strong>Click the OneNote</strong> attachment if you want to view or edit the notes in OneNote. If you don't have OneNote 2007, you can click the second attachment to view the notes as a Web page.<br /><br />You can download a free OneNote trial version from:` http://r.office.microsoft.com/r/rlidOneNoteTrial?clid=1033&ver=12&app=onenote.exe&p1=12

而是关闭具有指定效果的文本。那是因为一些Javascript错误?

谢谢 :)

4

1 回答 1

1

这可能是由于内容在您的视图中呈现之前被转义。作为安全预防措施,Rails 会自动执行此操作。在你看来,你可能有这样的事情:

<%= @model.content %>

尝试通过执行以下操作关闭转义:

<%= @model.content.html_safe %>

希望有帮助!

于 2013-09-25T19:03:39.233 回答