def sanitize(action)
      permissions = @permitted[action]

      if permissions.respond_to?(:call)
        cast_to_hash permissions.call(default_params)
      elsif permissions.present?
        cast_to_hash permit_keys(default_params, permissions)
      else
        unknown_action!(action)
      end
    end
def sanitize(action)
      permissions = @permitted[action]

      if permissions.respond_to?(:call)
        cast_to_hash permissions.call(default_params)
      elsif permissions.present?
        cast_to_hash permit_keys(default_params, permissions)
      else
        unknown_action!(action)
      end
    end
Sanitize the parameters for a specific +action+.

 === Arguments

 * +action+ - A +Symbol+ with the action that the controller is
   performing, like +sign_up+, +sign_in+, etc.

 === Examples

    # Inside the `RegistrationsController#create` action.
    resource = build_resource(devise_parameter_sanitizer.sanitize(:sign_up))
    resource.save

 Returns an +ActiveSupport::HashWithIndifferentAccess+ with the permitted
 attributes.