سؤال

I'm using RDiscount but my Ruby on Rails skills are limited. RDiscount has its .to_html function which converts the Markdown text into HTML. So here's the scenario:

<% @posts.each do |post| %>
<h3><%= post.title %></h3>
<%= post.content %>
<% end %>

post.content is what I want to convert to html.

1) Where should I create a method to convert the string into HTML?
2) How do I stop RoR from escaping the HTML that RDiscount.to_html returns?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top