Module: SteelWheel::RailsHelpers::ClassMethods

Defined in:
lib/steel_wheel/railtie.rb

Overview

rubocop:disable Style/Documentation

Instance Method Summary collapse

Instance Method Details

#action(action_name, handler: action_name, with_handlers: [], &block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/steel_wheel/railtie.rb', line 12

def action(action_name, handler: action_name, with_handlers: [], &block)
  composed_handlers = Array(with_handlers)

  define_method(action_name) do
    run_action(handler, composed_handlers, &block)
  end
end