instance method
_render_explicit_partial
Ruby on Rails 2.13.0
Since v2.6.4 Last seen in v2.13.0Signature
_render_explicit_partial(name_or_options, locals = {})
No documentation comment.
Parameters
-
name_or_optionsreq -
localsopt = {}
Source
# File lib/jbuilder/jbuilder_template.rb, line 254
def _render_explicit_partial(name_or_options, locals = {})
case name_or_options
when ::Hash
# partial! partial: 'name', foo: 'bar'
options = name_or_options
else
# partial! 'name', locals: {foo: 'bar'}
if locals.one? && (locals.keys.first == :locals)
options = locals.merge(partial: name_or_options)
else
options = { partial: name_or_options, locals: locals }
end
# partial! 'name', foo: 'bar'
as = locals.delete(:as)
options[:as] = as if as.present?
options[:collection] = locals[:collection] if locals.key?(:collection)
end
_render_partial_with_options options
end
Defined in lib/jbuilder/jbuilder_template.rb line 254
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Object