instance method
retrieve_variable
Ruby on Rails 4.0.13
Since v3.2.22.5 Last seen in v6.0.6 PrivateSignature
retrieve_variable(path, as)
No documentation comment.
Parameters
-
pathreq -
asreq
Source
# File actionpack/lib/action_view/renderer/partial_renderer.rb, line 474
def retrieve_variable(path, as)
variable = as || begin
base = path[-1] == "/" ? "" : File.basename(path)
raise_invalid_identifier(path) unless base =~ /\A_?([a-z]\w*)(\.\w+)*\z/
$1.to_sym
end
variable_counter = :"#{variable}_counter" if @collection
[variable, variable_counter]
end
Defined in actionpack/lib/action_view/renderer/partial_renderer.rb line 474
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::PartialRenderer