Sha256: 7ad3e1c7abd644d5fa816ed96dc230a510900928cc164b126670ad20701e98b5

Contents?: true

Size: 573 Bytes

Versions: 1

Compression:

Stored size: 573 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.7 lib/musterb/template_handler.rb