This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<% if @messages.empty? %> | |
There are no messages | |
<% else %> | |
<% @messages.each do |m| %> | |
<li><%= m.body %></li> | |
<% end %> | |
</ul> |
To clean it up a little, you can do:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<% if @messages.each do |m| %> | |
<li><%= m.body %></li> | |
<% end.empty? %> | |
<li>There are no messages</li> | |
<% end %> | |
</ul> |
Or else if each of your items is a partial, use the :collection method.
No comments:
Post a Comment