instance method bind_locals

Ruby on Rails 7.0.10

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

bind_locals(locals)

No documentation comment.

Parameters

locals req
Source
# File actionview/lib/action_view/unbound_template.rb, line 20
    def bind_locals(locals)
      if template = @templates[locals]
        template
      else
        @write_lock.synchronize do
          normalized_locals = normalize_locals(locals)

          # We need ||=, both to dedup on the normalized locals and to check
          # while holding the lock.
          @templates[normalized_locals] ||= build_template(normalized_locals)

          # This may have already been assigned, but we've already de-dup'd so
          # reassignment is fine.
          @templates[locals.dup] = @templates[normalized_locals]
        end
      end
    end

Defined in actionview/lib/action_view/unbound_template.rb line 20 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::UnboundTemplate

Type at least 2 characters to search.

↑↓ navigate · open · esc close