简体   繁体   English

在导轨上使用Redcarpet 4

[英]Using Redcarpet with rails 4

I installed Redcarpet. 我安装了Redcarpet。 I was following 272 Railscast tutorial on how to use it. 我正在关注272 Railscast教程,了解如何使用它。 I have this line in my show.html.erb 我的show.html.erb有这一行

 <%= Redcarpet.new(@topic.text).to_html %>

My rails app doesn't seem to know there's Redcarpet. 我的Rails应用似乎不知道有Redcarpet。 I gives a NoMethodError : 我给出了NoMethodError

undefined method `new' for Redcarpet:Module

How do I solve this? 我该如何解决?

Please try the following: 请尝试以下操作:

<%= Markdown.new(@topic.text).to_html %>

You might want to look at the definition of that method . 您可能需要查看该方法定义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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