class ActionDispatch::Routing::RouteSet::NamedRouteCollection

def define_url_helper(mod, name, helper, url_strategy)

Experimental RBS support (using type sampling data from the type_fusion project).

def define_url_helper: (Module mod, Symbol name, (ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper | ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper) helper, Proc url_strategy) -> Symbol

This signature was generated using 2 samples from 1 application.


foo_url(bar, baz, bang, sort_by: 'baz')

Also allow options hash, so you can do:

foo_url(bar: bar, baz: baz, bang: bang)

Instead of:

foo_url(bar, baz, bang)

with corresponding dynamic segments, so you can do:
Create a URL helper allowing ordered parameters to be associated
def define_url_helper(mod, name, helper, url_strategy)
  mod.define_method(name) do |*args|
    last = args.last
    options = \
      case last
      when Hash
        args.pop
      when ActionController::Parameters
        args.pop.to_h
      end
    helper.call(self, name, args, options, url_strategy)
  end
end