如何在rails 3.2中添加rails视图路径(ActionView :: PathSet)

我试图将视图前置到rails视图数组,例如

prepend_view_path( “#{Rails.root} /应用/视图/定制/嗒嗒”)

这很好,但是在我看到的测试套件中

弃用警告:不推荐使用process_view_paths,它将从Rails 3.2中删除。

经过一些研究后,我看到了ActionView :: PathSet的提及,但找不到任何搜索谷歌或Rails API文档的帮助。 我需要知道如何使用这种在rails 3.2中预先添加路径的新方法

我真的想摆脱这个警告。 有什么想法吗?

如果它是动态的(基于每个请求设置):

class ApplicationController < ActionController::Base before_filter :set_view_path def set_view_path prepend_view_path "#{Rails.root}/app/views/custom/blah" end end 

我认为它去了AbstractController::ViewPaths ,但仍然可以从控制器获得 - 应该没有弃用。

如果您在前面添加静态固定路径:

 # config/application.rb config.paths.app.views.unshift("#{Rails.root}/app/views/custom/blah")