Module: Papercat::PagesHelper

Includes:
ActionView::Template::Handlers
Defined in:
app/helpers/papercat/pages_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_page(page) ⇒ Object



5
6
7
8
# File 'app/helpers/papercat/pages_helper.rb', line 5

def render_page page
  body = page.body
  ERB.erb_implementation.new(page.body).result(binding).html_safe
end

#scriptsObject



16
17
18
19
20
# File 'app/helpers/papercat/pages_helper.rb', line 16

def scripts
   :script do
    Javascript.all.inject('') { |m, s| m + s.body }.html_safe
  end
end

#stylesheetsObject



10
11
12
13
14
# File 'app/helpers/papercat/pages_helper.rb', line 10

def stylesheets
   :style do
    Stylesheet.all.inject('') { |m, s| m + s.body }.html_safe
  end
end