Module: SigbitAdminRails::SidebarHelper
- Defined in:
- lib/sigbit_admin_rails/helpers/sidebar_helper.rb
Instance Method Summary collapse
Instance Method Details
#sidebar(*args, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/sigbit_admin_rails/helpers/sidebar_helper.rb', line 3 def (*args, &block) = args. if block_given? content_tag :div, id: 'sidebar-wrapper' do html = link_to '', [:brand_url], class: 'sidebar-brand hidden-sm-down' html << content_tag(:ul, class: 'sidebar-nav') do yield end html.html_safe end end end |
#sidebar_item(title, url, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sigbit_admin_rails/helpers/sidebar_helper.rb', line 16 def (title, url, &block) if block_given? content_tag :li do html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do yield end html.html_safe end else "<li>#{link_to title, url}</li>".html_safe end end |