Sha256: 3c797b177b1ae458ab0b7efece72b3064c482be265e247dd7513f9fbdc388a74

Contents?: true

Size: 553 Bytes

Versions: 8

Compression:

Stored size: 553 Bytes

Contents

require 'ruhl'

module Ruhl
  class Plugin < ActionView::TemplateHandler

    def initialize(action_view)
      @action_view = action_view
    end
    
    def render(template, options = {})
      layout = @action_view.controller.send(:active_layout)

      options[:layout]        = layout.filename
      options[:layout_source] = layout.source

      Ruhl::Engine.new(template.source, options).render(@action_view)
    end
  end
end

ActionView::Template.register_template_handler(:ruhl, Ruhl::Plugin)

ActionView::Template.exempt_from_layout(:ruhl)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ruhl-0.9.3 lib/ruhl/rails.rb
ruhl-0.9.2 lib/ruhl/rails.rb
ruhl-0.9.1 lib/ruhl/rails.rb
ruhl-0.9.0 lib/ruhl/rails.rb
ruhl-0.8.2 lib/ruhl/rails.rb
ruhl-0.8.1 lib/ruhl/rails.rb
ruhl-0.8.0 lib/ruhl/rails.rb
ruhl-0.7.0 lib/ruhl/rails.rb