【发布时间】:2011-05-05 02:13:17
【问题描述】:
有没有办法删除 Rails 3 中 gem 中指定的路由?异常记录器 gem 指定了我不想要的路由。我需要像这样在路线上指定约束:
scope :constraints => {:subdomain => 'secure', :protocol => 'https'} do
collection do
post :query
post :destroy_all
get :feed
end
end
基于Rails Engine docs,我想我可以创建一个猴子补丁并添加一个没有指定路由的路由文件到paths["config/routes"].paths 数组,但是该文件没有被添加到ExceptionLogger ::Engine.paths["config/routes"].paths
File: config/initializers/exception_logger_hacks.rb
ExceptionLogger::Engine.paths["config/routes"].paths.unshift(File.expand_path(File.join(File.dirname(__FILE__), "exception_logger_routes.rb")))
我在这里离基地很远吗?也许有更好的方法来做到这一点?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 rubygems routes overriding