Sha256: e28c30711e7e7a102e1a702a76c6ab3b9cf2a430bf54718059bf72c63ccafc41
Contents?: true
Size: 691 Bytes
Versions: 2
Compression:
Stored size: 691 Bytes
Contents
module AbAdmin module Menu class BaseGroup include ::Rails.application.routes.url_helpers def link(title, path, options={}) @menu_tree << Item.new(title, path, options) end def model(model, options={}) title = options[:title] || model.model_name.human(count: 9) url = options[:url] || "/admin/#{model.model_name.plural}" @menu_tree << Item.new(title, url, options) end def group(title, options={}, &block) @menu_tree << Group.new(title, options, &block) end def render_nested(template) @menu_tree.map { |item| item.render(template) }.compact.join.html_safe end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ab_admin-0.11.0 | lib/ab_admin/menu/base_group.rb |
ab_admin-0.10.0 | lib/ab_admin/menu/base_group.rb |