Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Documented passing of context as final argument to helpers #99

Open
wants to merge 1 commit into from

1 participant

@grncdr

This threw me for a loop when I was trying to define a variadic helper function. I couldn't think of a good Zappa-related example off the top of my head, unfortunately.

@grncdr

Sorry, I don't know about the motivation for this behaviour, I just added the note to the documentation because it bit me when I was adding a variadic helper. Is @mauricemach still involved with zappa? He'd be the guy to ask. To be honest I haven't used zappa in months, so I'm not particularly invested in this issue any more.

@shimaore shimaore referenced this pull request from a commit in zappajs/zappajs
@shimaore shimaore Fix for #41
(and mauricemach/zappa#99 incidentally)
41f8faa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 8, 2011
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 docs/0.3-gumbo/reference.md
View
5 docs/0.3-gumbo/reference.md
@@ -118,6 +118,11 @@ Since the parameter is actually an object, you can define any number of helpers
@sum: (a, b) -> a + b
@subtract: (a, b) -> a - b
+Finally, the request/event context is always passed as a final argument to the helper, allowing fat-arrow helpers:
+
+ @usefulThing
+ @helper thanks: (msg, ctx) => @usefulThing.thank(ctx.request.user, msg)
+
### @view
`@view path: contents`
Something went wrong with that request. Please try again.