Class: Padrino::Rendering::ERBTemplate
- Inherits:
-
Tilt::ERBTemplate
- Object
- Tilt::ERBTemplate
- Padrino::Rendering::ERBTemplate
- Defined in:
- lib/padrino/rendering/erb_template.rb
Instance Method Summary collapse
Instance Method Details
#precompiled_preamble(locals) ⇒ Object
27 28 29 30 31 |
# File 'lib/padrino/rendering/erb_template.rb', line 27 def precompiled_preamble(locals) original = super return original unless @is_padrino_app "__in_erb_template = true\n" << original end |
#prepare ⇒ Object
21 22 23 24 25 |
# File 'lib/padrino/rendering/erb_template.rb', line 21 def prepare @outvar = [:outvar] || self.class.default_output_variable [:trim] = '<>' if !([:trim] == false) && ([:trim].nil? || [:trim] == true) @engine = SafeERB.new(data, [:safe], [:trim], @outvar) end |
#render(*args) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/padrino/rendering/erb_template.rb', line 13 def render(*args) app = args.first app_class = app.class @is_padrino_app = (defined?(Padrino::Application) && app.kind_of?(Padrino::Application)) || (app_class.respond_to?(:erb) && app_class.erb[:safe_buffer]) super end |