Created
November 7, 2008 23:19
-
-
Save ctcherry/22993 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
*if block:* | |
Pretty straightforward. | |
<% if @property.floorplans.size == 1 %> | |
<div>Show This if the property only has 1 floorplan</div> | |
<% else %> | |
<div>Show This if the property has any other number of floorplans</div> | |
<% end %> | |
*unless block:* | |
unless is the opposite of an if. You can think of it as being an "if not" if that helps at all. Also I generally try to avoid unless + else because it can be a little bit hard to understand at first glance. | |
<% unless @property.floorplans.size == 1 %> | |
<div>Show This if the property has any other number of floorplans</div> | |
<% else %> | |
<div>Show This if the property only has 1 floorplan</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment