Skip to content

Instantly share code, notes, and snippets.

@diverted247
Created October 14, 2013 14:30
Show Gist options
  • Save diverted247/6976567 to your computer and use it in GitHub Desktop.
Save diverted247/6976567 to your computer and use it in GitHub Desktop.
Lapis - Select all users and render each in a div
lapis = require "lapis"
db = require "lapis.db"
html = require "lapis.html"
import Model from require "lapis.db.model"
class Users extends Model
class App extends lapis.Application
"/users": =>
users = Users\select!
@html ->
for user in *users
div user.username
lapis.serve( App )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment