Skip to content

Instantly share code, notes, and snippets.

@ToJans
Created February 3, 2011 16:13
Show Gist options
  • Save ToJans/809695 to your computer and use it in GitHub Desktop.
Save ToJans/809695 to your computer and use it in GitHub Desktop.
What am i doing wrong here ?
ReferenceError: session is not defined
at Object.<anonymous> (eval at <anonymous> (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/lib/coffeekup.js:186:12))
at anonymous (eval at <anonymous> (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/lib/coffeekup.js:186:12))
at Object.render (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/lib/coffeekup.js:206:12)
at Object.render (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:472:26)
at Object.<anonymous> (eval at <anonymous> (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:626:12))
at RequestHandler.anonymous [as handler] (eval at <anonymous> (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:626:12))
at RequestHandler.execute (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:443:21)
at Object.<anonymous> (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:250:26)
at param (/usr/local/lib/node/.npm/connect/0.5.6/package/lib/connect/middleware/router.js:147:21)
at pass (/usr/local/lib/node/.npm/connect/0.5.6/package/lib/connect/middleware/router.js:163:10)
get '/': -> redirect 'index'
get '/index': ->
render 'index'
put '/index': ->
session.tasks ?= []
session.tasks[session.tasks.length]=@subject
redirect 'index'
layout ->
head -> title 'todolist-zappa'
body -> @content
view index: ->
h1 'Todo-list Zappa'
if session.tasks?
ul ->
for l in session.tasks
li l
form ->
input type:'text', name:'subject'
input type:'submit'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment