I am using erb and ideally, I would like my html to look like this:
<li class="selected"><a href="awesome.html">Look at this awesome page</a></li>
Where both the path for the link, and the class for the li are dynamically generated using an instance variable.
Thoughts?
Edit 1
If I were using something like Rails, I know I could probably do something like:
<%= link_to content_tag(:li, nil, awesome_path, :class => "selected") %>
But that would produce the opposite effect, where the <a> would be outside of the <li> and not inside where I want it.
That’s called a helper:
and from erb: