Module: PureAdmin::DropdownHelper
- Defined in:
- app/helpers/pure_admin/dropdown_helper.rb
Overview
Note:
this helper depends MenuHelper
Helper methods for dropdown functionality.
The recommended way of using this helper is
dropdown 'Tools', class: ''do
dropdown_item :name, 'url', item_html: { class: '' }
end
Instance Method Summary collapse
-
#dropdown(name, options = {}) { ... } ⇒ Object
Renders a dropdown to the view.
-
#dropdown_item(name = nil, url = nil, options = nil) { ... } ⇒ Object
Renders a dropdown item to the view.
Instance Method Details
#dropdown(name, options = {}) { ... } ⇒ Object
Renders a dropdown to the view. respected here.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/helpers/pure_admin/dropdown_helper.rb', line 18 def dropdown(name, = {}, &block) opts = {} opts[:menu_html] = opts[:menu_html][:class] = merge_html_classes('dropdown pure-menu-horizontal', opts[:class]) content = capture(&block) content = content_tag(:ul, content, class: 'pure-menu-children') content = content_tag(:li, link_to(name, '', class: 'pure-menu-link') + content, class: 'pure-menu-item pure-menu-has-children') (opts) { content } end |
#dropdown_item(name = nil, url = nil, options = nil) { ... } ⇒ Object
Renders a dropdown item to the view.
37 38 39 |
# File 'app/helpers/pure_admin/dropdown_helper.rb', line 37 def dropdown_item(name = nil, url = nil, = nil, &block) (name, url, , &block) end |