From c95d9d68ea488c2de0bb5dcee0bb6490218e4e8f Mon Sep 17 00:00:00 2001 From: kpdecker Date: Sun, 19 May 2013 11:30:26 -0500 Subject: [PATCH] Use context rather than arg in README examples --- README.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.markdown b/README.markdown index d1b7fa68d..a3696d677 100644 --- a/README.markdown +++ b/README.markdown @@ -55,12 +55,12 @@ template. Here's an example, which assumes that your objects have a URL embedded in them, as well as the text for a link: ```js -Handlebars.registerHelper('link_to', function(context) { - return "" + context.body + ""; +Handlebars.registerHelper('link_to', function() { + return "" + this.body + ""; }); var context = { posts: [{url: "/hello-world", body: "Hello World!"}] }; -var source = "" +var source = "" var template = Handlebars.compile(source); template(context); @@ -130,12 +130,12 @@ When calling a helper, you can pass paths or Strings as parameters. For instance: ```js -Handlebars.registerHelper('link_to', function(title, context) { - return "" + title + "!" +Handlebars.registerHelper('link_to', function(title) { + return "" + title + "!" }); var context = { posts: [{url: "/hello-world", body: "Hello World!"}] }; -var source = '' +var source = '' var template = Handlebars.compile(source); template(context);