Module: Ramaze::View::Nagoro

Includes:
Optioned
Defined in:
lib/ramaze/view/nagoro.rb

Overview

Binding to the Nagoro templating engine.

To pipe your template through tidy you have to use:

Ramaze::View::Nagoro.options.tidy = true

See Also:

Class Method Summary (collapse)

Class Method Details

+ (Object) call(action, string)



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ramaze/view/nagoro.rb', line 24

def self.call(action, string)
  default_options = {
    :pipes     => options.pipes,
    :filename  => action.view,
    :binding   => action.binding,
    :variables => action.variables
  }

  render_options = default_options.merge(action.options)

  if options.tidy
    html = ::Nagoro.tidy_render(string.to_s, render_options)
  else
    html = ::Nagoro.render(string.to_s, render_options)
  end

  return html, 'text/html'
end