Created
June 10, 2014 03:27
-
-
Save jdibiccari/6a430c631c7baccd8633 to your computer and use it in GitHub Desktop.
blog_post_5
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
<!-- Example of an each loop --> | |
<ul> | |
<%Artist.list_alphabetically.each do |artist|%> | |
<li><a href="artists/<%=artist.url%>"><%=artist.name%></a> song count: <%=artist.songs_count%></li> | |
<%end%> | |
</ul> | |
<!-- Example of an if statement --> | |
<h4><%=artist.name%> - <%=artist.songs_count%> | |
<%if artist.songs_count > 1%> | |
Songs | |
<%else%> | |
Song | |
<%end%> | |
</h4> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment