instance method
_render_partial_with_options
Ruby on Rails 2.14.1
Since v2.4.1 Last seen in v2.14.1 PrivateSignature
_render_partial_with_options(options)
No documentation comment.
Parameters
-
optionsreq
Source
# File lib/jbuilder/jbuilder_template.rb, line 148
def _render_partial_with_options(options)
options[:locals] ||= options.except(:partial, :as, :collection, :cached)
options[:handlers] ||= ::JbuilderTemplate.template_lookup_options[:handlers]
as = options[:as]
if as && options.key?(:collection)
collection = options.delete(:collection) || []
partial = options.delete(:partial)
options[:locals][:json] = self
collection = EnumerableCompat.new(collection) if collection.respond_to?(:count) && !collection.respond_to?(:size)
if options.has_key?(:layout)
::Kernel.raise ::NotImplementedError, "The `:layout' option is not supported in collection rendering."
end
if options.has_key?(:spacer_template)
::Kernel.raise ::NotImplementedError, "The `:spacer_template' option is not supported in collection rendering."
end
if collection.present?
results = CollectionRenderer
.new(@context.lookup_context, options) { |&block| _scope(&block) }
.render_collection_with_partial(collection, partial, @context, nil)
array! if results.respond_to?(:body) && results.body.nil?
else
array!
end
else
_render_partial options
end
end
Defined in lib/jbuilder/jbuilder_template.rb line 148
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in JbuilderTemplate