Module: Refinery::MenuHelper

Defined in:
core/app/helpers/refinery/menu_helper.rb

Instance Method Summary collapse

Instance Method Details

#cache_if(condition, name = {}, &block) ⇒ Object

Adds conditional caching



5
6
7
8
9
10
11
12
13
14
15
16
# File 'core/app/helpers/refinery/menu_helper.rb', line 5

def cache_if(condition, name = {}, &block)
  Refinery.deprecate('cache_if', when: '3.1')

  if condition
    cache(name, &block)
  else
    yield
  end

  # for <%= style helpers vs <% style
  nil
end