Module: Rage::Router::DSLPlugins::LegacyHashNotation

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

Overview

Support legacy URL helpers that use hashes instead of the :to keyword argument.

Examples:

get "/photos/:id" => "photos#show"
mount Sidekiq::Web => "/sidekiq"
get "search" => :index
get "admin_users" => "users"

Instance Method Summary collapse

Instance Method Details

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



37
38
39
40
41
42
43
44
45
# File 'lib/rage/router/dsl_plugins/legacy_hash_notation.rb', line 37

def mount(*args, **kwargs)
  if args.empty? && !kwargs.empty?
    app, at = kwargs.first
    options = kwargs.except(app).merge(at: at)
    super(app, **options)
  else
    super
  end
end