method

encode_for_template

rails latest stable - Class: ActionDispatch::Request::Utils::CustomParamEncoder

Method not available on this version

This method is only available on newer versions. The first available version (v8.0.0) is shown here.

encode_for_template(params, encoding_template)
public

No documentation available.

# File actionpack/lib/action_dispatch/request/utils.rb, line 86
        def self.encode_for_template(params, encoding_template)
          return params unless encoding_template
          params.except(:controller, :action).each do |key, value|
            ActionDispatch::Request::Utils.each_param_value(value) do |param|
              # If `param` is frozen, it comes from the router defaults
              next if param.frozen?

              if encoding_template[key.to_s]
                param.force_encoding(encoding_template[key.to_s])
              end
            end
          end
          params
        end