Ryan Leavengood wrote:
> 
> The above works (I tested it) but I think this is more Rubyish:
> 
> <table>
>   <tr>
>     <th>Songs</th>
>   </tr>
>   <% if song_list.empty? %>
>     <tr>
>       <td>no songs!</td>
>     </tr>
>   <% else song_list.each do |song|%>
>       <tr>
>         <td><%= song.name %></td>
>       </tr>
>     <% end %>
>   <% end %>
>   </tr>
> </table>
> 
> i.e. get rid of the for entirely.

I don't object to the 'for' (although I know some don't like it).

FWIW I'll offer this (untested) alternative:

  <table>
    <tr><th>Songs</th></tr>
    <% unless song_list.each do |song|%>
      <tr><td><%= song.name %></td></tr>
      <% end.empty? %>
      <tr><td>no songs!</td></tr>
    <% end %>
    </tr>
  </table>


Hal