Skip to content

Instantly share code, notes, and snippets.

@mark-d-holmberg
Forked from stephencelis/redcarpet.rb
Created February 15, 2012 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mark-d-holmberg/1833366 to your computer and use it in GitHub Desktop.
Save mark-d-holmberg/1833366 to your computer and use it in GitHub Desktop.
Redcarpet (Markdown) template handler for Rails 3.1.
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