I am rendering my main top navigation in a loop in Rails 3:
<ul>
<% Placement.all.each do |placement| %>
<li><%= link_to placement.placementname, placement_path(placement.id)%> </li>
<%end%>
</ul>
How can I highlight the background of the current placement based on the id in the url? the url looks like this:
localhost:3000/placements/1
localhost:3000/placements/2
…
Once the user clicks on one of those tabs a second navigation bar will appear on the left side. This is how I am rendering it:
<% @placement.ads.all.each do |ad| %>
<li><%= link_to ad.adname, placement_ad_path(@placement, ad) %> </li>
<%end%>
How can I highlight the background of the current ad based on the id in the url? the url looks like this: localhost:3000/placements/1/ads/1
localhost:3000/placements/2/ads/3
…
and