Rails 4 WYSIWYG Bootsy 不显示格式 [英] Rails 4 WYSIWYG Bootsy not displaying formatting

查看:53
本文介绍了Rails 4 WYSIWYG Bootsy 不显示格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚按照 bootsy gem 页面 上的安装说明进行操作,直到我保存并查看帖子的内容.

I've just followed the install instructions at the the bootsy gem page and it all looks good until I save and look at the post's content.

这是输出在视图中的样子:

This is what the output looks like in the view:

<h2>Header</h2><h3>Sub head:</h3><br><img alt="Thumb 1320236280147" src="/uploads/bootsy/image/1/1320236280147.jpg">

似乎没有任何 html 格式被渲染,因为它被引号或类似的东西转义 - 有没有其他人遇到过这个问题?我在 github 页面或 SO 上没有看到任何问题来为我指明正确的方向.

It seems that none of the html formatting is being rendered as it is being escaped by quoation marks or something like that - has anyone else had this problem? I haven't seen any issues on the github page or on SO to point me in the right direction.

除了遵循 gem 安装说明之外,我还没有做任何事情,但也许我错过了一些东西,或者只是犯了一个愚蠢的错误.

I haven't done anything yet apart from follow the gem install instructions but maybe I missed something or am just making a stupid mistake.

如果您还有什么想知道的,请尽管问.

If there's anything else you want to know please just ask.

干杯

推荐答案

你需要有这样的东西,转义html:

You need to have something like this, escape html:

<%= f.bootsy_area(:body, class: 'bg-code').html_safe %>

这篇关于Rails 4 WYSIWYG Bootsy 不显示格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆