有没有办法在Rails 3中删除gem中指定的路由?异常记录器gem指定了我不想要的路由.我需要在路由上指定约束,如下所示:
scope :constraints => {:subdomain => 'secure', :protocol => 'https'} do
collection do
post :query
post :destroy_all
get :feed
end
end
Run Code Online (Sandbox Code Playgroud)
基于Rails Engine文档,我想我可以创建一个猴子补丁并添加一个没有指定路径的路由文件["config/routes"].paths数组但是该文件没有添加到ExceptionLogger :: Engine .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")))
Run Code Online (Sandbox Code Playgroud)
我离开基地吗?也许还有更好的方法吗?