instance method bind_locals

Ruby on Rails edge

Since v6.0.6.1

Available in: v6.0.6.1 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

bind_locals(locals)

No documentation comment.

Parameters

locals req
Source
# File actionview/lib/action_view/unbound_template.rb, line 21
    def bind_locals(locals)
      if @strict_locals_template
        @strict_locals_template
      elsif frozen?
        templates = ractor_local_templates
        unless template = templates[locals]
          normalized_locals = normalize_locals(locals)
          template = templates.compute_if_absent(normalized_locals) { build_template(normalized_locals) }
          templates[locals.dup] = template
        end
        template
      else
        @templates[locals] || build_bound_template(locals)
      end
    end

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

Defined in ActionView::UnboundTemplate

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close