I have a very simple route setup, which allows me to first show "all" entries for an object. Then, if the user selects a drop-down list, they can filter it down using the date.
I recently upgraded to RC2 and realized that the "needs" have replaced or will soon replace controllerFor.
I am curious how I can use “needs” in the situation below, when I need a nested / internal route for “records.date” to change the content for the parent “record” route when choosing a date.
What is missing below is that inside App.RecordsDateRoute I need to change the contents of the recording controller so that it becomes a new filter (by date this time), and all that seems to me is just resetting the steering wheel template and not showing anything - even when I try to use something simple like
this.controllerFor("records").set('content', App.Record.find(new Date(model.loaded)))
from setupController method to ReportDateRoute
App.Router.map(function(match) { return this.resource("records", { path: "/" }, function() { return this.route("date", { path: "/:date_loaded" }); }); }); App.RecordsController = Ember.ArrayController.extend({ selected: 0, dates: Ember.computed(function() { return App.Date.find(); }).property() }); App.RecordsIndexRoute = Ember.Route.extend({ model: function() { this.controllerFor("records").set("selected", 0); return App.Record.find(); } }); App.RecordsDateRoute = Ember.Route.extend({ model: function(params) {
source share