Skip to content

Instantly share code, notes, and snippets.

@shwoodard
Created September 24, 2012 02:49
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 shwoodard/3773936 to your computer and use it in GitHub Desktop.
Save shwoodard/3773936 to your computer and use it in GitHub Desktop.
App.NewStoryView = Ember.View.extend
storyTitle: null
templateName: 'stories/new'
classNameBindings: ['hide']
hide: false
storyTitleDidChange: (->
console.log @toString()
console.log @get('storyTitle')
).observes('storyTitle')
clear: ->
@set('storyTitle', null)
createStory: ->
console.log @toString()
story = App.store.createRecord App.Story,
title: @get('storyTitle')
solution: @get('controller.content')
story.didCreate = =>
@get('controller.content.stories').pushObject(story)
@clear()
App.store.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment