Module: WizardOfAwes::ViewHelpers

Defined in:
lib/wizard_of_awes/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#woa_markdown(snippet) ⇒ Object



15
16
17
# File 'lib/wizard_of_awes/view_helpers.rb', line 15

def woa_markdown(snippet)
  snippet.body
end

#woa_snippet(*slug) ⇒ Object

Options

  • :slug - Which snippet to look up. Defaults to the current_page slug



5
6
7
8
9
10
11
12
13
# File 'lib/wizard_of_awes/view_helpers.rb', line 5

def woa_snippet(*slug)
  s = slug.present? ? slug : request.fullpath
  snippet = HelperSnippet.find_by_slug(s)
  if snippet
    woa_markdown(snippet) 
  else
    "No Snippet Found"
  end
end