Ruby on rails Rails路由弃用警告
我有一个Rails 4.2.1应用程序,并在我的routes.rb中收到了一个弃用警告Ruby on rails Rails路由弃用警告,ruby-on-rails,ruby,ruby-on-rails-4,Ruby On Rails,Ruby,Ruby On Rails 4,我有一个Rails 4.2.1应用程序,并在我的routes.rb中收到了一个弃用警告 DEPRECATION WARNING: Defining a route where `to` is a controller without an action is deprecated. Please change `to: :super_admin` to `controller: :super_admin`. (called from block in <top (required)>
DEPRECATION WARNING: Defining a route where `to` is a controller without an action is deprecated. Please change `to: :super_admin` to `controller: :super_admin`. (called from block in <top (required)>
我必须更改什么?使用
controller::super\u admin
而不是to::super\u admin
。这也在弃用警告消息中提到。使用controller::super\u admin
而不是to::super\u admin
。弃用警告消息中也提到了这一点。真正正确的是::controller=>:super\u admin
,但感谢您的提示!我很高兴能帮助你:)真正正确的是::controller=>:super_admin
但是谢谢你的提示!我很高兴能帮助你:)为什么这是被高估的?为什么这是被高估的?
get "/super_admin(/:action(/:id))", :to => "super_admin", :constraints => {:subdomain => "admin"}
get "/", :to => redirect("/super_admin"), :constraints => {:subdomain => "admin"}
get "/super_admin(/:action(/:id))", :to => "super_admin", :constraints => {:subdomain => "admin.staging"}
get "/", :to => redirect("/super_admin"), :constraints => {:subdomain => "admin.staging"}
get "/super_admin(/:action(/:id))", :to => redirect("/")