开发者

rails 3 - additional views in a different directory

开发者 https://www.devze.com 2023-03-22 14:00 出处:网络
I am look at upgrading our legacy rails 2 app to rails 3. One thing is that we have an 开发者_运维问答additional set of view files in a different directory.

I am look at upgrading our legacy rails 2 app to rails 3. One thing is that we have an 开发者_运维问答additional set of view files in a different directory. In rails 2 I had an initializer that did this:

ActionController::Base.view_paths.unshift File.join("#{RAILS_ROOT}/app/renderers", 'views')

How can I do a similar thing in rails 3?


Here's how you'd do it now:

SampleApplication::Application.config.paths.app.views << File.join( Rails.root, 'app', 'complementary_views' )
0

精彩评论

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