替代Rails 3中的prepend / append_view_path?
我正在尝试将另一个目录添加到Rails查找视图的路径中,我在方法ActionController :: Base.prepend_view_path和ActionController :: Base.append_view_path中找到了一个可行的解决方案,但它们都被标记为已弃用Rails 3.有没有我可以使用的替代方案?
http://apidock.com/rails/ActionController/Base/prepend_view_path
http://apidock.com/rails/ActionController/Base/append_view_path
不推荐使用ActionController::Base.append/prepend_view_paths
,因为它们被提取到AbstractController
模块中。 如果从控制器调用这些方法,则会调用AbstractController
方法,而不是已弃用的ActionController
。
https://github.com/rails/rails/blob/master/actionpack/lib/abstract_controller/view_paths.rb#L25