instance method _render_explicit_partial

Ruby on Rails 2.10.2

Since v2.6.4 Last seen in v2.13.0

Available in: v2.6.4 v2.7.0 v2.8.0 v2.9.1 v2.10.2 v2.11.5 v2.12.0 v2.13.0

Signature

_render_explicit_partial(name_or_options, locals = {})

No documentation comment.

Parameters

name_or_options req
locals opt = {}
Source
# File lib/jbuilder/jbuilder_template.rb, line 197
  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 197 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Object

Type at least 2 characters to search.

↑↓ navigate · open · esc close