Class: Padrino::Rendering::ERBTemplate
- Defined in:
- lib/padrino/rendering/erb_template.rb
Instance Method Summary collapse
Instance Method Details
#precompiled_preamble(locals) ⇒ Object
49 50 51 52 53 |
# File 'lib/padrino/rendering/erb_template.rb', line 49 def precompiled_preamble(locals) original = super return original unless @is_padrino_app "__in_erb_template = true\n" << original end |
#prepare ⇒ Object
34 35 36 37 38 39 |
# File 'lib/padrino/rendering/erb_template.rb', line 34 def prepare @outvar = [:outvar] || self.class.default_output_variable [:trim] = '<>' if !([:trim] == false) && ([:trim].nil? || [:trim] == true) @engine = SafeERB.new(data, trim_mode: [:trim], eoutvar: @outvar) end |
#render(*args) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/padrino/rendering/erb_template.rb', line 25 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 |