views:

23

answers:

1

Hi All,

In our application we are storing some views (.erb files) in public/custom_themes/{user}/ folders. We have tried to add the path RAILS_ROOT to view_paths and specifying the /custom_themes/{user}/theme.erb in render :layout. In development environment it works fine, but in production it takes ages to find the views. It did find but takes around 2-4 minutes to find and render.

Please advise.

Thanks,

Imran

+3  A: 

Don't use RAILS_ROOT - you don't need the entire rails application (including all vendored/cached gems and plugins!) to be searched. You only need to add your custom_themes directory:

self.view_paths = ['app/views/', "#{RAILS_ROOT}/public/custom_themes/"]

This should speed it considerably.

Jaime Bellmyer
thanks Jaime and Shingara
Imran