Created
September 1, 2014 13:09
-
-
Save antoinelyset/16715598b6cfadb5f676 to your computer and use it in GitHub Desktop.
Markdown in Rails with Kramdown
This file contains 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
# config/initializers/templates.rb | |
module KramdownTemplateHandler | |
def self.call(template) | |
"'#{Kramdown::Document.new(template.source).to_html}'.html_safe" | |
end | |
end | |
ActionView::Template.register_template_handler :md, KramdownTemplateHandler | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment