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

后端 未结 8 1686
小蘑菇
小蘑菇 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:59

    Not a pure markdown solution but you can use HAML filters to render markdown, as well as other markup languages.

    For example, in app/views/_my_partial.html.haml:

    :markdown
      My awesome view
      ===============
    
      Look, I can **use** #{language}!
    

提交回复
热议问题