On 31 Oct 2008, at 12:36, Matthijs Langenberg wrote:

>
> While testing the Rails 2.2.0 release I soon knew I had a problem: I'm
> relying on the fact that an ERB template is recompiled if the
> modification time of the file has been updated.
>
> I work on a multisite Rails app, which uses 'request.host' to do a
> Site.find_by_domain and uses a before filter to call
> 'prepend_view_path("#{RAILS_ROOT}/themes/[EMAIL PROTECTED]/templates").
> It's also possible to upload a new theme for a specific site via an
> admin backend.
> It's comparable to Shopify, but instead of using Liquid it relies on
> Rails' templating mechanism.
>
> The line of code that made this work is located here:
> http://github.com/rails/rails/tree/v2.1.2/actionpack/lib/action_view/template_handlers/compilable.rb#L70
>  
> ,
> but in rails-2.2.0 thing have been rewritten and the check is
> unfortunately gone: 
> http://github.com/rails/rails/tree/v2.2.0/actionpack/lib/action_view/renderable.rb#L90
>  
> .
>
> Currently this means that I need to run this app in production with
> 'config.cache_classes = false' in order to upgrade to Rails 2.2.0,
> which reloads all application code on every requests. That's going to
> be slow. Another solution is restarting the whole app after changing
> the theme for a single site.
>
> Is there a way for me to reset the template cache manually after a
> theme has been updated?
You could just override that recompile? method

Fred


>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to