Skip to content

Instantly share code, notes, and snippets.

@mauricemach
Created September 30, 2011 02:15
Show Gist options
  • Save mauricemach/1252491 to your computer and use it in GitHub Desktop.
Save mauricemach/1252491 to your computer and use it in GitHub Desktop.
# auth_helper.coffee
@include = ->
helper auth: (cb) ->
if session.user
@user = session.user
cb()
else
redirect '/login'
# account_controller.coffe
@include = ->
get '/account': ->
auth ->
render 'account'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment