instance method retrieve_variable

Ruby on Rails 5.2.8.1

Since v3.2.22.5 Last seen in v6.0.6 Private

Available in: v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6

Signature

retrieve_variable(path, as)

No documentation comment.

Parameters

path req
as req
Source
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 524
      def retrieve_variable(path, as)
        variable = as || begin
          base = path[-1] == "/".freeze ? "".freeze : File.basename(path)
          raise_invalid_identifier(path) unless base =~ /\A_?(.*?)(?:\.\w+)*\z/
          $1.to_sym
        end
        if @collection
          variable_counter = :"#{variable}_counter"
          variable_iteration = :"#{variable}_iteration"
        end
        [variable, variable_counter, variable_iteration]
      end

Defined in actionview/lib/action_view/renderer/partial_renderer.rb line 524 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::PartialRenderer

Type at least 2 characters to search.

↑↓ navigate · open · esc close