我正在开发一个使用 Rails 引擎的 Ruby on Rails 3(.0) 应用程序。但是,在我的本地应用程序中,我想覆盖 Rails 引擎提供的路由之一。
从引擎配置/routes.rb:
match 'their_named_route' => 'controller#action', :as => 'the_route'
从我的应用程序配置/routes.rb:
match 'my_named_route' => 'controller#action', :as => 'the_route'
但是,当我检查路线时,两者似乎都处于活动状态(并且它们的路线似乎“获胜”,至少在引擎控制器内)
$ rake routes
the_route /my_named_route(.:format) {:controller=>"controller", :action=>"action"}
the_route /their_named_route(.:format) {:controller=>"controller", :action=>"action"}
有没有一种好方法可以强制我的本地应用程序的命名路由优先?