Skip to content
Lance Pollard edited this page Apr 12, 2012 · 1 revision

Model Generator

tower generate model Post title:string body:text belongsTo:user

Generates:

|-- app
|   |-- models
|   |   |   `-- post.coffee

The Post model generated:

class App.Post extends Tower.Model
  @field "id", type: "Id"
  @field "title"
  @field "body"
  @belongs_to "user", type: "User", foreignKey: "userId"
  @field "createdAt", type: "Time", default: -> new Date()

Tower.js

Everything here will be reflected on http://towerjs.org/guides.

Clone this wiki locally