Class: Markaby::Rails::TemplateHandler

### Home Classes Methods

### In Files

- lib/markaby/rails/current.rb

### Parent

ActionView::TemplateHandler

### Methods

- #compile
- #render

### Included Modules

- ActionView::TemplateHandlers::Compilable

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Markaby
- Markaby::Builder
- Markaby::BuilderTags
- Markaby::CssProxy
- Markaby::Fragment
- Markaby::InvalidXhtmlError
- Markaby::Rails
- Markaby::Rails::ActionControllerHelpers
- Markaby::Rails::Helpers
- Markaby::Rails::RailsBuilder
- Markaby::Rails::RailsBuilder::FormHelperProxy
- Markaby::Rails::RailsBuilder::OutputBuffer
- Markaby::Rails::Template
- Markaby::Rails::TemplateHandler
- Markaby::Stream
- Markaby::Tilt
- Markaby::XHTMLFrameset
- Markaby::XHTMLStrict
- Markaby::XHTMLTransitional
- Markaby::XmlMarkup
- Sinatra
- Sinatra::Base
- Sinatra::Templates
- Kernel
- Object

No matching classes.

# Markaby::Rails::TemplateHandler

### Attributes

view[RW]

### Public Instance Methods

compile(template, local_assigns={}) click to toggle source

    # File lib/markaby/rails/current.rb, line 8
    def compile(template, local_assigns={})
                __template_handler = Markaby::Rails::TemplateHandler.new          __template_handler.view = self          __template_handler.render(lambda {            #{template.source}          }, local_assigns)
    end

render(template, local_assigns = (template.respond_to?(:locals) ? template.locals : {})) click to toggle source

    # File lib/markaby/rails/current.rb, line 18
    def render(template, local_assigns = (template.respond_to?(:locals) ? template.locals : {}))
      builder = RailsBuilder.new(instance_variables.merge(local_assigns), @view)
      @view.output_buffer = builder

      template.is_a?(Proc) ?
        builder.instance_eval(&template) :
        builder.instance_eval(template.source)

      builder.to_s
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.