diff --git a/Liquid-for-Programmers.md b/Liquid-for-Programmers.md index 06e2ad8..f1373d2 100644 --- a/Liquid-for-Programmers.md +++ b/Liquid-for-Programmers.md @@ -108,12 +108,14 @@ Liquid::Template.register_tag('random', Random) ``` ```ruby -@template = Liquid::Template.parse(" {% random 5 %}") +@template = Liquid::Template.parse("{% random 5 %}") @template.render # => "3" ``` ### Using Assignments in Templates +You can also use assigned variables in your tags. To do so, use the context object passed to your render() method. In this example, we multiply any value supplied to the parameter as a tag by the configured "multiply_by" assigned value. + ```ruby class Multiply < Liquid::Tag def initialize(tag_name, factor, tokens)