instance method _normalize_args

Ruby on Rails 7.2.3

Since v4.1.16 Private

Available in: v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

_normalize_args(action = nil, options = {})

Normalize args by converting render “foo” to render action: “foo” and render “foo/bar” to render template: “foo/bar”.

Parameters

action opt = nil
options opt = {}
Source
# File actionview/lib/action_view/rendering.rb, line 152
      def _normalize_args(action = nil, options = {})
        options = super(action, options)
        case action
        when NilClass
        when Hash
          options = action
        when String, Symbol
          action = action.to_s
          key = action.include?(?/) ? :template : :action
          options[key] = action
        else
          if action.respond_to?(:permitted?) && action.permitted?
            options = action
          elsif action.respond_to?(:render_in)
            options[:renderable] = action
          else
            options[:partial] = action
          end
        end

        options
      end

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

Defined in ActionView::Rendering

Type at least 2 characters to search.

↑↓ navigate · open · esc close