首页 文章

使用带有导轨的Redcarpet 4

提问于
浏览
1

我安装了Redcarpet . 我正在关注如何使用它的272 Railscast教程 . 我在 show.html.erb 中有这一行

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

我的rails应用程序没有't seem to know there'的Redcarpet . 我给了 NoMethodError

undefined method `new' for Redcarpet:Module

我该如何解决这个问题?

1 回答

  • 4

    请尝试以下方法:

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

    您可能想查看definition of that method .

相关问题