Module: Hancock::Cache::Admin
- Defined in:
- lib/hancock/cache/admin/fragment.rb,
lib/hancock/cache/admin.rb,
lib/hancock_cms_cache.rb
Defined Under Namespace
Modules: Fragment
Class Method Summary collapse
Class Method Details
.caching_block(is_active = false, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/hancock/cache/admin.rb', line 4 def self.caching_block(is_active = false, = {}) if is_active.is_a?(Hash) is_active, = (is_active[:active] || false), is_active end Proc.new { active is_active label [:label] || I18n.t('hancock.cache') field :perform_caching, :toggle field :cache_keys_str, :text do searchable true end field :cache_fragments do read_only true formatted_value do bindings and bindings[:object] and bindings[:object].cache_fragments.all.to_a.map do |_frag| bindings[:view].link_to( _frag.name, bindings[:view].show_path(model_name: _frag.rails_admin_model, id: _frag.id), ) end.join(", ").html_safe end end Hancock::RailsAdminGroupPatch::hancock_cms_group(self, [:fields] || {}) if block_given? yield self end } end |