Module: ApplicationHelper

Includes:
Jinda::Helpers
Defined in:
lib/jinda/railtie.rb,
lib/generators/jinda/templates/app/helpers/application_helper.rb

Defined Under Namespace

Classes: CodeRayify

Instance Method Summary collapse

Instance Method Details

#markdown(text) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/generators/jinda/templates/app/helpers/application_helper.rb', line 22

def markdown(text)
  coderayified     = CodeRayify.new(filter_html: true,
                                    hard_wrap: true)
  options          = {
    fenced_code_blocks: true,
    no_intra_emphasis: true,
    autolink: true,
    lax_html_blocks: true
  }
  markdown_to_html = Redcarpet::Markdown.new(coderayified, options)
  markdown_to_html.render(text).html_safe
end

#meta_description(blog_text) ⇒ Object



8
9
10
# File 'lib/generators/jinda/templates/app/helpers/application_helper.rb', line 8

def meta_description(blog_text)
  content_for(:meta_description) { blog_text }
end

#title(blog_title) ⇒ Object



4
5
6
# File 'lib/generators/jinda/templates/app/helpers/application_helper.rb', line 4

def title(blog_title)
  content_for(:title) { blog_title }
end