After the release of Rails 2.0 RC1 I’m trying to have a kind of “theme support” working by using view_paths.
I’m using in my application controller
<pre>
def get_theme
@settings=session[:loadedsettings]
@style=@settings.theme.nil? ? "default": @settings.theme
self.view_paths[0]="#{RAILS_ROOT}/themes/#{@style}"
self.view_paths[1]="#{RAILS_ROOT}/themes/#{@style}/views"
self.view_paths[2]="#{RAILS_ROOT}/app/views"
return @style
end
</pre>
it works by having layout :get_theme in my controllers and to have “style”.html.erb in the good directory but when using partials it renders the normal template using /app/views and not the one in the dedicated directory, I need to test gain to find my answer.
comments : 0 Add comment
