Sha256: a74483d9170ddbc577967d7c22e6f3eb0072db5f12c817340397b78e263db54c
Contents?: true
Size: 736 Bytes
Versions: 19
Compression:
Stored size: 736 Bytes
Contents
namespace :imagine_cms do namespace :cache do desc "Clear CMS cache (generated .html files)" task :clear => :environment do include ActionDispatch::Routing::UrlFor include Rails.application.routes.url_helpers # expire home page ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => nil, :only_path => true) # expire all other pages CmsPage.select([ :id, :path ]).find_each do |page| ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => page.path.split('/'), :only_path => true) end puts "Cache cleared." end end end
Version data entries
19 entries across 19 versions & 1 rubygems