Redcarpetを使えば簡単だった
Gmefile
gem 'redcarpet'
controller
@info = Info.find(params[:id])
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
@html = markdown.render(@info.content)
view
<%= @html.html_safe %>
More than 5 years have passed since last update.
gem 'redcarpet'
@info = Info.find(params[:id])
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
@html = markdown.render(@info.content)
<%= @html.html_safe %>
Register as a new user and use Qiita more conveniently