rails 3 - additional views 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' )
精彩评论