Skip to content

Instantly share code, notes, and snippets.

@webdevotion
Last active April 8, 2018 01:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save webdevotion/5781670 to your computer and use it in GitHub Desktop.
Save webdevotion/5781670 to your computer and use it in GitHub Desktop.
markdown
module ApplicationHelper
def markdown(text, options = {} )
options = [
:hard_wrap => true,
:space_after_headers => true,
:filter_html => true,
:autolink => true,
:no_intraemphasis => true,
:fenced_code => true,
:gh_blockcode => true,
:safe_links_only => true,
:xhtml => false,
:no_images => true
]
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,*options)
markdown.render(text).html_safe
end
end
<nav>
<ul class="grid">
<li><%= link_to "Shops", shops_path %></li>
<li><%= link_to "Books", books_path %></li>
<li><%= link_to "Chapters", chapters_path %></li>
</ul>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment