Sha256: e338566a9468058b8c0b593eaac9fad6cf336215e56f83ba8bcb81415857c518
Contents?: true
Size: 612 Bytes
Versions: 7
Compression:
Stored size: 612 Bytes
Contents
module MenuMaker module MenuHelper def menu_maker(active_path = nil, &block) renderers = MenuRendererContainer.new do |c| c.add_for_next_depth(CustomMenuRenderer.new self, active_path) c.add_for_next_depth(CustomSubmenuRenderer.new self, active_path) end Menu.new(renderers, &block).render end def li(title, url = nil, options = {}) link_options = options.fetch(:link, {}) options.reject! { |k,v| k == :link } content = link_to_if(url.present?, title, url, link_options) content_tag(:li, content, options).html_safe end end end
Version data entries
7 entries across 7 versions & 1 rubygems