Module: Refinery::MenuHelper

Defined in:
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
# File 'app/helpers/refinery/menu_helper.rb', line 5

def cache_if(condition, name = {}, &block)
  if condition
    cache(name, &block)
  else
    yield
  end

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