Sha256: 6ac5800b105f66f4c6f26827e41b229a4da16deab3405777bae64fa3abcb33a2
Contents?: true
Size: 539 Bytes
Versions: 9
Compression:
Stored size: 539 Bytes
Contents
module HookHelper # Allow hooks to be used in views like this: # # <%= hook :some_hook %> # # <% hook :some_hook do %> # <p>Some HTML</p> # <% end %> # def hook(hook_name, locals = {}, &block) content = block_given? ? capture(&block) : '' result = Spree::ThemeSupport::Hook.render_hook(hook_name, content, self, locals) block_given? ? concat(result.to_s) : result end def locals_hash(names, binding) names.inject({}) {|memo, key| memo[key.to_sym] = eval(key, binding); memo} end end
Version data entries
9 entries across 9 versions & 1 rubygems