My Routes
NoteApp.Router.reopen
location: 'history'
rootURL: '/'
NoteApp.Router.map ->
@resource 'notes', path: "/", ->
@route 'new', path: "/new"
NoteApp.NotesRoute = Ember.Route.extend
model: ()->
return @store.find('note')
NoteApp.NotesNewRoute = Ember.Route.extend
renderTemplate: (controller, model) ->
@render 'notes/new', into: "application"
My NotesNewController is:
NoteApp.NotesNewController = Ember.ObjectController.extend
actions:
createNote: ->
title = @get('newTitle')
note = @store.createRecord('note',
title: title
)
note.save()
@set('newTitle', '')
@transitionToRoute('notes')
First problem: I can't use browser back button after navigate to /new route
Second problem: @transitionToRoute('notes')
not working. Simply render blank page.