Hi Guys,
I have this helper code and using it well on some projects. But I want it somehow to be able to add an inner
< ul > list.
Here’s the code I use for the haml files
nav_link_to 'Dashboard', 'block layout', 'admin-dashboard.html'
And here’s the helper code
def nav_link_to name, icon, url
path = request.path
class_name = (path == url) ? ' class="active"' : ''
"<li#{class_name}><a href=\"#{url}\"><i class=\"icon #{icon}\"></i>#{name}</a></li>"
end
I would like to have an output like this below:
<ul>
<li class="active"><a href="admin-dashboard.html"><i class="icon block layout"></i>???</a></li>
<li><a href="admin-links.html"><i class="icon linkify"></i>???</a>
<ul class="dropdown">
<li><a href="admin-links.html"><i class="icon linkify"></i>???</a></li>
<li><a href="admin-links.html"><i class="icon linkify"></i>???</a></li>
</ul>
</li>
</ul>
Thanks in advance!