Skip to content

Instantly share code, notes, and snippets.

@aileron
Created February 7, 2013 20:26
Show Gist options
  • Save aileron/4733884 to your computer and use it in GitHub Desktop.
Save aileron/4733884 to your computer and use it in GitHub Desktop.
Ruby on rails markdown( Redcarpet ) used view helper
module MarkdownHelper
_markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
:autolink => true, :space_after_headers => true)
define_method :markdown do |text|
raw _markdown.render(text)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment