Module: RailsPulse::CachedComponentHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/rails_pulse/cached_component_helper.rb

Instance Method Summary collapse

Instance Method Details

#cached_component(options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/rails_pulse/cached_component_helper.rb', line 3

def cached_component(options)
  # cache_key = ComponentCacheKey.build(options[:id], options[:context])

  # Add refresh action for panels if requested
  if options[:refresh_action] && options[:component] == "panel"
    options[:actions] ||= []
    options[:actions] << refresh_action_params(options[:id], options[:context], options[:content_partial])
  end

  # if Rails.cache.exist?(cache_key)
  if false
    render_cached_content(options)
  else
    render_skeleton_with_frame(options)
  end
end