From a14f3f93a20aa79a7519352319bdbf2823227346 Mon Sep 17 00:00:00 2001 From: Roman Suleymanov Date: Thu, 7 Nov 2019 18:04:50 +0500 Subject: [PATCH] fix `add_controller_module': undefined method `start_with?' for :blocks:Symbol (NoMethodError) controller can be string or symbol --- actionpack/lib/action_dispatch/routing/mapper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index fc1fbfd40ecc8..96cd1aa2ccd95 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -355,7 +355,7 @@ def split_to(to) def add_controller_module(controller, modyoule) if modyoule && !controller.is_a?(Regexp) - if controller && controller.start_with?("/") + if %r{\A/}.match?(controller) controller[1..-1] else [modyoule, controller].compact.join("/")