I'm trying to add a "current" class to the following set of links based on if there is an "order" param in the URL. (ie. example.com/photos?order=views). I need some help refactoring this so it's not so burly.
<% unless params[:order] != 'created_at' %>
<%= link_to "Recently Posted", photos_path, :class => 'current' %>
<% else %>
<%= link_to "Recently Posted", photos_path %>
<% end %>
<span class="pipe">|</span>
<% unless params[:order] != 'comments' %>
<%= link_to "Most Commented", photos_path + "?order=comments", :class => 'current' %>
<% else %>
<%= link_to "Most Commented", photos_path + "?order=comments" %>
<% end %>
<span class="pipe">|</span>
<% unless params[:order] != 'views' %>
<%= link_to "Most Viewed", photos_path + "?order=views", :class => 'current' %>
<% else %>
<%= link_to "Most Viewed", photos_path + "?order=views" %>
<% end %>