Skip to content

Instantly share code, notes, and snippets.

@randito
Created March 27, 2014 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randito/9811008 to your computer and use it in GitHub Desktop.
Save randito/9811008 to your computer and use it in GitHub Desktop.
Ember example controller (in coffeescript)
# From: http://emberjs.com/guides/getting-started/creating-a-new-model/
Todos.TodosController = Ember.ArrayController.extend
actions:
createTodo: ->
title = @get 'newTitle'
return unless title.trim()
@set 'newTitle', ''
@store.createRecord 'todo',
title: title
isCompleted: false
.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment