Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 912
phil Avatar asked Sep 02 '25 05:09

phil


1 Answers

Here's how you'd do it now:

SampleApplication::Application.config.paths.app.views << File.join( Rails.root, 'app', 'complementary_views' )
like image 160
Maurício Linhares Avatar answered Sep 05 '25 01:09

Maurício Linhares