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.
This commit is contained in:
parent
063b028190
commit
63256bc5d7
@ -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 controller && controller.to_s.start_with?("/")
|
||||
controller[1..-1]
|
||||
else
|
||||
[modyoule, controller].compact.join("/")
|
||||
|
@ -4962,7 +4962,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
|
||||
|
Loading…
Reference in New Issue
Block a user