ruby-on-rails – Rails 3:添加DISQUS gem以供评论
发布时间:2020-12-17 02:11:17 所属栏目:百科 来源:网络整理
导读:嗨,我正在尝试在Rails 3应用程序中使用DISCUS评论.这似乎不是一个很好的指南来设置它. 评论系统不会显示,我在视图中看到的是: script type="text/javascript"var disqus_developer = 1;/scriptdiv id="disqus_thread"/divscript type="text/javascript" src
嗨,我正在尝试在Rails 3应用程序中使用DISCUS评论.这似乎不是一个很好的指南来设置它.
评论系统不会显示,我在视图中看到的是: <script type="text/javascript">var disqus_developer = 1;</script><div id="disqus_thread"></div> <script type="text/javascript" src="http://disqus.com/forums/gppublic/embed.js"></script> <noscript><a href="http://gppublic.disqus.com/?url=ref">View the discussion thread</a></noscript> 这是我设置它的步骤: 1)gem install disqus 2)将配置块放在application.rb中并??添加您的特定帐户名称 config.after_initialize do Disqus::defaults[:account] = "youraccountname" # so that the comments will load up in development environment Disqus::defaults[:developer] = true Disqus::defaults[:container_id] = "disqus_thread" Disqus::defaults[:show_powered_by] = false end 3)然后放在我的节目视图中 <div id ="disqus_thread"> <%= disqus_thread %> </div> 我哪里错了?谢谢 解决方法
我认为你需要使用raw或html_safe.
= raw disqus_thread 要么 = disqus_thread.html_safe (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- flex4.5 for VideoPlayer 简单应用
- xml – 如何在XSL中总结for-each循环的结果?
- C#对图片进行马赛克处理可控制模糊程度的实现代码
- c – cast operator() – 强制转换为引用并转换为值
- ruby-on-rails – Eclipse用户:你也使用Aptana吗?
- Halo 导航器的子代必须实现 INavigatorContent
- Ruby Open-URI库在404 HTTP错误代码中中止
- ruby-on-rails – 努力理解如何在rails中保存模型和关联
- xcode – 如果点击UITextField,如何制作出现的UIPickerView
- postgresql – Postgres错误:无法打开文件进行阅读:权限被