Module: Rage::Router::DSLPlugins::LegacyRootNotation

Included in:
Rage::Router::DSL::Handler
Defined in:
lib/rage/router/dsl_plugins/legacy_root_notation.rb

Overview

Support legacy root helpers that don't use the :to keyword argument.

Examples:

root "photos#index"

Instance Method Summary collapse

Instance Method Details

#root(*args, **kwargs) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/rage/router/dsl_plugins/legacy_root_notation.rb', line 7

def root(*args, **kwargs)
  if args.length == 1 && args[0].is_a?(String) && kwargs.empty?
    super(to: args[0])
  else
    super
  end
end