mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
Migrated from liquid-for-programmers v8
@@ -112,5 +112,5 @@ Liquid::Template.register_tag('random', Random)
|
|||||||
<pre><code>
|
<pre><code>
|
||||||
text = " {% random 5 %} wanna hear a joke? {% endrandom %} "
|
text = " {% random 5 %} wanna hear a joke? {% endrandom %} "
|
||||||
@template = Liquid::Template.parse(text)
|
@template = Liquid::Template.parse(text)
|
||||||
@template.render # => in 20% of the cases this will output : wanna hear a joke?
|
@template.render # => In 20% of the cases, this will output "wanna hear a joke?"
|
||||||
</code></pre>
|
</code></pre>
|
||||||
Reference in New Issue
Block a user