Module: Ramaze::View::Erubis

Defined in:
lib/ramaze/view/erubis.rb

Overview

View adapter for the Erubis template engine. More information about Erubis can be found here: http://www.kuwata-lab.com/erubis/

Constant Summary

OPTIONS =
{ :engine => ::Erubis::Eruby }

Class Method Summary (collapse)

Class Method Details

+ (Object) call(action, string)



14
15
16
17
18
19
20
21
22
23
# File 'lib/ramaze/view/erubis.rb', line 14

def self.call(action, string)
  options = OPTIONS.dup
  engine = options.delete(:engine)

  eruby = View.compile(string){|s| engine.new(s, options) }
  eruby.init_evaluator(:filename => (action.view || __FILE__))
  html = eruby.evaluate(action.instance)

  return html, 'text/html'
end