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

Methods included from Jinda::Helpers

#affirm, #ajax?, #align_text, #authorize?, #authorize_init?, #b, #code_div, #code_text, #controller_exists?, #current_ma_user, #date_thai, #dup_hash, #freemind2action, #get_app, #get_default_role, #get_ip, #get_option, #get_option_xml, #link_to_blank, #listed, #login?, #ma_comment?, #ma_log, #ma_secured?, #name2camel, #name2code, #negate, #own_xmain?, #process_services, #read_binary, #redirect_to_root, #refresh_to, #role_name, #set_global, #status_icon, #step, #true_action?, #ui_action?, #uncomment

Instance Method Details

#markdown(text) ⇒ Object



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

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



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

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

#title(blog_title) ⇒ Object



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

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