How can I automatically render partials using markdown in Rails 3?

后端 未结 8 1689
小蘑菇
小蘑菇 2020-12-12 12:58

I want to have some of my partials as markdown snippets. What is the easiest way to render them using the standard rails erb templating?

Ideally, I\'d like to do so

8条回答
  •  死守一世寂寞
    2020-12-12 13:52

    I just released a markdown-rails gem, which handles .html.md views.

    You cannot chain it with Erb though -- it's only for static views and partials. To embed Ruby code, you'd have to use tjwallace's solution with :markdown.

提交回复
热议问题