Sha256: 8b30bf39c410130744b1d5ebe6a376f32de9c1cb292f6a38e06892fbfc5891cd

Contents?: true

Size: 572 Bytes

Versions: 20

Compression:

Stored size: 572 Bytes

Contents

module Rabl
  module Partials
    include Helpers
    include Sources

    def partial_as_engine(file, options = {}, &block)
      raise ArgumentError, "Must provide an :object option to render a partial" unless options.has_key?(:object)

      object    = options.delete(:object)
      view_path = options[:view_path] || self.view_path

      source, location = fetch_source(file, :view_path => view_path)

      options = options.merge(:source => source, :source_location => location, :template => file)
      object_to_engine(object, options, &block)
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rabl-0.17.0 lib/rabl/partials.rb
rabl-0.16.1 lib/rabl/partials.rb
rabl-0.16.0 lib/rabl/partials.rb
rabl-0.15.0 lib/rabl/partials.rb
rabl-0.14.5 lib/rabl/partials.rb
rabl-0.14.4 lib/rabl/partials.rb
rabl-0.14.3 lib/rabl/partials.rb
rabl-0.14.2 lib/rabl/partials.rb
rabl-0.14.1 lib/rabl/partials.rb
rabl-0.14.0 lib/rabl/partials.rb
rabl-0.13.1 lib/rabl/partials.rb
rabl-0.13.0 lib/rabl/partials.rb
rabl-0.12.0 lib/rabl/partials.rb
rabl-0.11.8 lib/rabl/partials.rb
rabl-0.11.7 lib/rabl/partials.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/rabl-0.11.6/lib/rabl/partials.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/rabl-0.11.6/lib/rabl/partials.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/rabl-0.11.6/lib/rabl/partials.rb
rabl-0.11.6 lib/rabl/partials.rb
rabl-0.11.5 lib/rabl/partials.rb