Created
May 22, 2011 09:00
-
-
Save paneq/985286 to your computer and use it in GitHub Desktop.
Faster rendering due to caching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to: | |
# Rails.root/config/environments/development.rb | |
# Faster rendering: | |
# Technique described here: | |
# http://rails.lighthouseapp.com/projects/8994/tickets/5847-rails-301-configaction_viewcache_template_loading-is-missing | |
# | |
# According to Jose this is already in Rails 3.1 | |
raise NotImplementedError if Rails.version.starts_with?("3.1") | |
ActiveSupport.on_load(:after_initialize) do | |
ActionView::Resolver.class_eval do | |
def caching? | |
true | |
end | |
end | |
ActionController::Base.before_filter do | |
ActionController::Base.view_paths.each(&:clear_cache) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment