Skip to content

Instantly share code, notes, and snippets.

@mauricemach
Created September 7, 2011 18:31
Show Gist options
  • Save mauricemach/1201327 to your computer and use it in GitHub Desktop.
Save mauricemach/1201327 to your computer and use it in GitHub Desktop.
helper requires_login: (cb) ->
if request.session.user then cb()
else redirect "/sessions/new?redir=" + request.url
get "/accounts/new": ->
requires_login ->
render "home/accountNew"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment