Sha256: 8fc5395382e63fdd83df51986d783f22491650dd483791a1618521004f5537e5
Contents?: true
Size: 1010 Bytes
Versions: 2
Compression:
Stored size: 1010 Bytes
Contents
<% # headmin/nav/item # # ==== Options # * +name</tt> - Name of the nav item # * +url</tt> - URL for this nav item # * +icon</tt> - Optional Bootstrap icon name # * +active</tt> - Set to true if this nav item needs to be highlighted # # ==== Examples # Basic version. # <%= render "headmin/nav/item", name: 'Dashboard', url: admin_root_path %#> # # With icon # <%= render "headmin/nav/item", name: 'Dashboard', url: admin_root_path, icon: 'speedometer' %#> name = local_assigns.has_key?(:name) ? name : '' icon = local_assigns.has_key?(:icon) ? icon : nil url = local_assigns.has_key?(:url) ? url : request.url active = local_assigns.has_key?(:active) ? active : current_url?(url) %> <li class="nav-item"> <a class="nav-link d-flex align-items-center <%= 'active' if active %>" aria-current="page" href="<%= url %>"> <%= bootstrap_icon(icon, class: 'me-2') if icon %> <span class="d-block d-md-none d-lg-block"> <%= name %> </span> </a> </li>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
headmin-0.5.1 | app/views/headmin/nav/_item.html.erb |
headmin-0.5.0 | app/views/headmin/nav/_item.html.erb |