Skip to content

Instantly share code, notes, and snippets.

@rmosolgo
Created July 20, 2014 21:40
Show Gist options
  • Select an option

  • Save rmosolgo/af187927a243b815df7f to your computer and use it in GitHub Desktop.

Select an option

Save rmosolgo/af187927a243b815df7f to your computer and use it in GitHub Desktop.
Initialize a batman.js model with a hasMany child
class MyApp.TasksController extends MyApp.ApplicationController
new: ->
task = new MyApp.Task
task.get('task_entries').build(item: new MyApp.Item)
@set('task', task)
# /tasks/new will be rendered implicitly. MyApp.TasksNewView will be used to render that template, if it is defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment