Module: ActionArgs::AbstractControllerMethods

Defined in:
lib/action_args/abstract_controller.rb

Instance Method Summary collapse

Instance Method Details

#send_action(method_name, *args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/action_args/abstract_controller.rb', line 8

def send_action(method_name, *args)
  unless args.empty?
    kwargs = args.extract_options!
    if kwargs.any?
      return super(method_name, *args, **kwargs)
    else
      return super
    end
  end

  return super if !defined?(params) || params.nil?

  strengthen_params! method_name
  values, kwargs_values = extract_method_arguments_from_params method_name
  if kwargs_values.any?
    super method_name, *values, **kwargs_values
  else
    super method_name, *values
  end
end