I realized that I\'m writing a lot of code similar to this one:
<% unless @messages.blank? %> <% @messages.each do |message| %> <%# cod
One way is to do something like:
<%= render(:partial => @messages) || render('no_messages') %>
Edit:
If I remember correctly this was made possible by this commit:
http://github.com/rails/rails/commit/a8ece12fe2ac7838407954453e0d31af6186a5db