I am currently in the process of strategizing the layout for a webpage utilizing Bootstrap 4 within Ruby on Rails. Specifically, I need to create a sidebar submenu that can expand and collapse, feature bullet points, and include a counter.
The desired outcome should resemble the following:
Alpha 4000
* Major One 2000
Minor One 500
Minor Two 1500
* Major Two 1000
At this point, my approach involves using HTML/CSS to structure an unordered list as follows:
<ul>
<li><a href="menu1" data-toggle="collapse">Major One</a></li>
<ul class="collapse" id="menu1">
<li>Minor One</li>
<li>Minor Two</li>
</ul>
</li>
<li>Major Two</li>
</ul>
Upon further reflection, I realized the necessity of implementing a counter within the unordered list and potentially dividing the columns within the ul li tags. This made me consider if there is a more streamlined way in Ruby to accomplish this task. Is there a more efficient Ruby method for generating a two-column unordered list with collapse functionality and a count?