Skip to content

Instantly share code, notes, and snippets.

@MartinElvar
Last active December 27, 2015 14:59
Show Gist options
  • Save MartinElvar/7343977 to your computer and use it in GitHub Desktop.
Save MartinElvar/7343977 to your computer and use it in GitHub Desktop.
Issues with createRecord
Sanatid.Router.map ()->
@route 'home.index', { path: '/' }
@resource 'jobs', ->
@route 'new'
Sanatid.JobsNewRoute = Ember.Route.extend
setupController: (controller) ->
debugger
controller.set 'model', @store.createRecord('Job', {})
controller.set 'serviceFields', @store.find('ServiceField')
Sanatid.JobsNewController = Ember.ObjectController.extend
serviceFields: []
selectedServiceField: null
actions:
selectServiceField: (serviceField) ->
@set('selectedServiceField', serviceField)
selectService: (service) ->
@set('service', service)
debugger
reset: ->
@set('selectedServiceField', null)
@set('service', null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment