Module: BreadcrumbsHelper
- Included in:
- Kuppayam::BaseController
- Defined in:
- app/helpers/breadcrumbs_helper.rb
Instance Method Summary collapse
-
#breadcrumb ⇒ Object
Initialize @links in your controller action.
- #breadcrumbs_configuration ⇒ Object
- #configure_breadcrumbs ⇒ Object
- #default_breadcrumbs_configuration ⇒ Object
Instance Method Details
#breadcrumb ⇒ Object
Initialize @links in your controller action
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/helpers/breadcrumbs_helper.rb', line 22 def if && .has_key?(:links) && [:links].any? content_tag(:div, class: "breadcrumb-env hidden-xs") do content_tag(:ol, class: "breadcrumb bc-1") do li_array = [] [:links].each do |item| li_class = item[:active] == true ? "active" : "" li_array << content_tag(:li, class: li_class) do i_tag = item.has_key?(:icon) ? "<i class='#{item[:icon]}'></i>" : "" if item[:active] raw("#{i_tag}<strong>#{item[:name]}</strong>") else link_to(raw("#{i_tag} #{item[:name]}"), item[:link] ) end end end raw(li_array.join(" ")) end end end end |
#breadcrumbs_configuration ⇒ Object
3 4 5 |
# File 'app/helpers/breadcrumbs_helper.rb', line 3 def {} end |
#configure_breadcrumbs ⇒ Object
16 17 18 19 |
# File 'app/helpers/breadcrumbs_helper.rb', line 16 def = .reverse_merge!() end |
#default_breadcrumbs_configuration ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'app/helpers/breadcrumbs_helper.rb', line 7 def { heading: "Heading", description: "Description for the Page", links: [{name: "Home", link: "#", icon: 'fa-home'}, {name: "Current Page", link: "#", icon: 'fa-calendar', active: true}] } end |