Created
January 3, 2014 20:10
-
-
Save jakecraige/8245586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saveNewPhoto: -> | |
newImage = @store.createRecord 'event_image', { | |
image: @get 'newPhotoImage' | |
caption: @get 'newPhotoCaption' | |
event: @get 'model' | |
} | |
newImage.save().then ((img)=> | |
@get('event_images').pushObject img | |
Ea.get('flash').success 'Image added' | |
), (=> | |
Ea.get('flash').alert 'Error adding image. Please try again later.' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment