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?
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?
It seems that there are 2 different view_paths used:
So when theming your whole application you have to do something like:
self.class.prepend_view_path("#{RAILS_ROOT}/themes/#
{self.current_theme}/views") # This is for the layouts :S
self.prepend_view_path("#{RAILS_ROOT}/themes/#
{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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs