Class: Padrino::Rendering::ErubisTemplate

### Home Classes Methods

### In Files

- lib/padrino/rendering/erubis_template.rb

### Parent

Tilt::ErubisTemplate

### Methods

- #precompiled_preamble
- #render

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Helpers
- Padrino::Helpers::AssetTagHelpers
- Padrino::Helpers::FormBuilder
- Padrino::Helpers::FormBuilder::AbstractFormBuilder
- Padrino::Helpers::FormBuilder::DeprecatedBuilderMethods
- Padrino::Helpers::FormBuilder::StandardFormBuilder
- Padrino::Helpers::FormHelpers
- Padrino::Helpers::FormHelpers::Errors
- Padrino::Helpers::FormHelpers::Options
- Padrino::Helpers::FormHelpers::Security
- Padrino::Helpers::NumberHelpers
- Padrino::Helpers::OutputHelpers
- Padrino::Helpers::OutputHelpers::AbstractHandler
- Padrino::Helpers::OutputHelpers::ErbHandler
- Padrino::Helpers::OutputHelpers::HamlHandler
- Padrino::Helpers::OutputHelpers::SinatraCurrentEngine
- Padrino::Helpers::OutputHelpers::SlimHandler
- Padrino::Helpers::RenderHelpers
- Padrino::Helpers::TagHelpers
- Padrino::Helpers::TranslationHelpers
- Padrino::Rendering
- Padrino::Rendering::ClassMethods
- Padrino::Rendering::ErubisTemplate
- Padrino::Rendering::HamlTemplate
- Padrino::Rendering::InstanceMethods
- Padrino::Rendering::SafeBufferEnhancer
- Padrino::Rendering::SafeEruby
- Padrino::Rendering::SafeTemplate
- Padrino::Rendering::SlimTemplate
- Padrino::Rendering::TemplateNotFound
- Haml
- Haml::Helpers
- Haml::Util

No matching classes.

# Padrino::Rendering::ErubisTemplate

Modded ErubisTemplate that doesn't insist in an String as output buffer.

@api private

### Public Instance Methods

precompiled_preamble(locals) click to toggle source

In preamble we need a flag `__in_erb_template` and SafeBuffer for padrino apps.

    # File lib/padrino/rendering/erubis_template.rb, line 53
    def precompiled_preamble(locals)
      original = super
      return original unless @is_padrino_app
      "__in_erb_template = true\n" << original.rpartition("\n").first << "#{@outvar} = _buf = ActiveSupport::SafeBuffer.new\n"
    end

render(*args) click to toggle source

    # File lib/padrino/rendering/erubis_template.rb, line 42
    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[:engine_class] == Padrino::Rendering::SafeEruby)
      super
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.