ruby on rails // current_page?
I recently ran into a situation where I needed to know what the current page was in order to apply the proper css class in a view in rails. [That's a long sentence ;)] Anyways it turns out to be cake. Snippet:
Also, in case anyone wondered, this is code from a divless/tableless layout. I do all of my sites this way now.
<ul>
<% unless current_page? :action => "index" %>
<li><%= link_to "Home", {:action => "index"} %></li>
<% else %>
<li class="tab_menu_active">Home</li>
<% end %>
</ul>
Also, in case anyone wondered, this is code from a divless/tableless layout. I do all of my sites this way now.

