开发者

Alternative to prepend/append_view_path in Rails 3?

I'm trying to add another directory to the paths that Rails looks in to find views, and I found a working solution in the methods ActionController::Base.prepend_view_pat开发者_开发知识库h and ActionController::Base.append_view_path, but they are both marked as deprecated in Rails 3. Is there an alternative that I can use?

http://apidock.com/rails/ActionController/Base/prepend_view_path

http://apidock.com/rails/ActionController/Base/append_view_path


The ActionController::Base.append/prepend_view_paths were deprecated, as they were extracted out into the AbstractController module. If you call those methods from your controller, the AbstractController methods would be called, not the deprecated ActionController one.

https://github.com/rails/rails/blob/master/actionpack/lib/abstract_controller/view_paths.rb#L25

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜