method

local_assigns

Importance_1
v6.1.3.1 - Show latest stable - 0 notes - Class: ActionView::Template
local_assigns public

Returns a hash with the defined local variables.

Given this sub template rendering:

<%= render "shared/header", { headline: "Welcome", person: person } %>

You can use local_assigns in the sub templates to access the local variables:

local_assigns[:headline] # => "Welcome"
Show source
Register or log in to add new notes.