-
-
Save mark-d-holmberg/1833366 to your computer and use it in GitHub Desktop.
Redcarpet (Markdown) template handler for Rails 3.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActionView::Template | |
class Markdown | |
def call(template) | |
Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(template.source).inspect | |
end | |
end | |
ActionView::Template.register_template_handler :md, Markdown.new | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment