Forum: Ruby on Rails prepend_view_path and layouts

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Joost (Guest)
on 2009-02-06 16:23
(Received via mailing list)
When using prepend_view_path in a before_filter in
application_controller it renders all views correctly from the added
view path. However layouts are still from the default location..

Any ideas?
Joost (Guest)
on 2009-02-09 11:19
(Received via mailing list)
It seems that there are 2 different view_paths used:
- The class one.. (is the only one used on layouts)
- The instance one.. (is used on other views)

So when theming your whole application you have to do something like:

{self.current_theme}/views") # This is for the layouts :S
{self.class.current_theme}/views") # This is for the actions

This probably isn't thread safe, etc..etc..

But WHY is Rails using 2 DIFFERENT view_paths ??
This topic is locked and can not be replied to.