Controller can be symbols as well

Symbol doesn't respond to `start_with?` so we need to change it to
string before doing the comparison.
上级 c3135a4d
......@@ -350,7 +350,7 @@ def split_to(to)
def add_controller_module(controller, modyoule)
if modyoule && !controller.is_a?(Regexp)
if controller && controller.start_with?("/")
if controller && controller.to_s.start_with?("/")
controller[1..-1]
else
[modyoule, controller].compact.join("/")
......
......@@ -4964,7 +4964,7 @@ class TestOptionalScopesWithOrWithoutParams < ActionDispatch::IntegrationTest
app.draw do
scope module: "test_optional_scopes_with_or_without_params" do
scope "(:locale)", locale: /en|es/ do
get "home", to: "home#index"
get "home", controller: :home, action: :index
get "with_param/:foo", to: "home#with_param", as: "with_param"
get "without_param", to: "home#without_param"
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册