Module: ActionView::Helpers::TextHelper

Defined in:
lib/radiant_helper_text_helper.rb

Instance Method Summary collapse

Instance Method Details

#load_radiant_page(slug, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/radiant_helper_text_helper.rb', line 5

def load_radiant_page(slug, options = {})
  text = "<!-- Loading cms slug: '#{slug}' -->\n"
  begin
    res = Radiant::Helper::Page.retrieve(slug, request)
    if res.success?
      text << res.body
    else
      raise res.exception
    end
  rescue Exception => e
    text << "<!-- Error: #{e.message} -->"
  end
  text << "\n<!-- Loaded cms slug: '#{slug}' -->"
  text
end