instance method _render_explicit_partial

Ruby on Rails 2.4.1

Since v2.4.1 Last seen in v2.5.0 Private

Available in: v2.4.1 v2.5.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 145
  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 145 · View on GitHub · Improve this page · Find usages on GitHub

Defined in JbuilderTemplate

Type at least 2 characters to search.

↑↓ navigate · open · esc close