Sha256: dbad8ca4c2e7b7a1ddc133d4645de895a2a7e18023be623285b4fcd5a90c23c1

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

require 'musterb'

module Musterb::TemplateHandler
  def self.render_partial_template(partial)
    "render :partial => '#{partial}', :locals => {:initial_context => musterb.context}"
  end

  def self.call(template)
   options = {:render_partial_template => method(:render_partial_template)}
   options[:initial_context] = "initial_context" if template.locals.include? :initial_context
   erb = Musterb.to_erb(template.source, options)
   klass = ActionView::Template::Handlers::ERB
   klass.erb_implementation.new(erb, :trim => (klass.erb_trim_mode == "-")).src
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
musterb-0.0.6 lib/musterb/template_handler.rb