简体   繁体   中英

ERROR: Invalid Renderer instance given in ruby on rails

I'm newbie on ruby on rails application, from last few days I'm suffering about Markdown with Redcarpet issue, I following this tutorial , I'm don't understanding why showing this error.

Invalid Renderer instance given

This is my helper:

def markdown(text)
  #Redcarpet.new(text).to_html.html_safe
  Redcarpet::Markdown.new(text).to_html
end

My View:

 <%= markdown(@details.post_details) %>

Gemfile:

gem 'redcarpet'

That would help me a lot, please.

I think should work, after following this:

  <%= markdown(@details.post_details) %>

Should try

 <%= raw @details.post_details %>

Work for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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