Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在关注本教程,但它一直在说“Redcarpet:Module 的未定义方法‘新’”。我的 Gemfile 中有 gem "redcarpet"。失败的代码:
Redcarpet.new(@post.content).to_html
好的,看起来 Redcarpet 2 已经完全改变了 API。以下作品:
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true) raw markdown.render(@post_content.content)