class ActionDispatch::Routing::RouteSet::Generator

def use_relative_controller!

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

def use_relative_controller!: () -> untyped

This signature was generated using 3 samples from 1 application.

is specified, the controller becomes "foo/baz/bat"
if the current controller is "foo/bar/baz" and controller: "baz/bat"
def use_relative_controller!
  if !named_route && different_controller? && !controller.start_with?("/")
    old_parts = current_controller.split("/")
    size = controller.count("/") + 1
    parts = old_parts[0...-size] << controller
    @options[:controller] = parts.join("/")
  end
end