From d1bb11252d6270249c9b22e91ccb41855e9b33ce Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Thu, 20 Mar 2014 19:58:12 -0700 Subject: [PATCH] Clarify a not-null example. Fixes #247 --- Liquid-for-Designers.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Liquid-for-Designers.md b/Liquid-for-Designers.md index b18caab..fedbde8 100644 --- a/Liquid-for-Designers.md +++ b/Liquid-for-Designers.md @@ -120,6 +120,13 @@ optionally, `elsif` and `else`) clause: {% endif %} ``` +``` +# Same as above +{% if user != null %} + Hello {{ user.name }} +{% endif %} +``` + ```liquid {% if user.name == 'tobi' %} Hello tobi @@ -153,20 +160,6 @@ optionally, `elsif` and `else`) clause: {% endunless %} ``` -```liquid -# Check if the user has a credit card -{% if user.creditcard != null %} - poor sob -{% endif %} -``` - -```liquid -# Same as above -{% if user.creditcard %} - poor sob -{% endif %} -``` - ```liquid # Check for the size of an array {% if user.payments == empty %} @@ -176,7 +169,6 @@ optionally, `elsif` and `else`) clause: {% if user.payments.size > 0 %} you paid ! {% endif %} - ``` ```liquid @@ -379,4 +371,4 @@ the given variable instead of rendering it to the screen. -``` +``` \ No newline at end of file