Class: Plugins::FrontCache::AdminController
- Inherits:
-
CamaleonCms::Apps::PluginsAdminController
- Object
- CamaleonCms::CamaleonController
- CamaleonCms::AdminController
- CamaleonCms::Apps::PluginsAdminController
- Plugins::FrontCache::AdminController
- Includes:
- FrontCacheHelper
- Defined in:
- app/apps/plugins/front_cache/admin_controller.rb
Constant Summary
Constants included from FrontCacheHelper
FrontCacheHelper::FRONT_CACHE_EXPIRATION
Instance Method Summary collapse
Methods included from FrontCacheHelper
#front_cache_before_load, #front_cache_clean, #front_cache_front_after_load, #front_cache_front_before_load, #front_cache_on_active, #front_cache_on_inactive, #front_cache_on_render, #front_cache_plugin_options, #front_cache_post_requests
Methods inherited from CamaleonCms::AdminController
#ajax, #cama_get_i18n_frontend, #dashboard, #index, #search
Instance Method Details
#clean_cache ⇒ Object
28 29 30 31 32 33 |
# File 'app/apps/plugins/front_cache/admin_controller.rb', line 28 def clean_cache flash[:notice] = t('plugin.front_cache.message.cache_destroyed').to_s front_cache_clean front_cache_purge_stored_pages redirect_to(request.referer || '/admin/plugins') end |
#save_settings ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/apps/plugins/front_cache/admin_controller.rb', line 11 def save_settings current_site.( 'front_cache_elements', { paths: (params[:cache][:paths] || []).compact_blank || [], posts: params[:cache][:posts] || [], post_types: params[:cache][:post_type] || [], skip_posts: params[:cache][:skip_posts] || [], cache_login: params[:cache][:cache_login], home: params[:cache][:home], preserve_cache_on_restart: params[:cache][:preserve_cache_on_restart] } ) flash[:notice] = t('plugin.front_cache.message.settings_saved').to_s redirect_to action: :settings end |
#settings ⇒ Object
6 7 8 9 |
# File 'app/apps/plugins/front_cache/admin_controller.rb', line 6 def settings @caches = current_site.('front_cache_elements', { paths: [] }) @caches[:paths] << '' if @caches[:paths].blank? end |