I find myself frequently writing code like this in the HTML HEAD and other places:
<% if @canonical_url %>
<link rel="canonical" href="<%= @canonical_url %>"/>
<% end %>
I then set the variable in the controller if it's appropriate.
Is there any way of writing the equivalent on one line, or maybe a different way of organizing the code?