Reputation: 896
My app has two models Url and UrlType and I want to select UrlType via select box. How do I do that? Here is the jsbin where I tried to reproduce the scenario, though this.get('store') do not work :( But the idea must be pretty clear.
http://emberjs.jsbin.com/nefas/6/edit
Upvotes: 1
Views: 65
Reputation: 1729
Few things with your jsbin.
this.store
din not work as you have not mentioned your adapter like this
App.ApplicationAdapter = DS.FixtureAdapter;
You din not return in the model return
.
Though you have got around what you wanted, I have made a jsbin that might have what you want. http://emberjs.jsbin.com/saxuy/1/edit
http://emberjs.jsbin.com/saxuy/6/edit
You could set the url_type
attribute of your url model directly like this in your template.
{{view Ember.Select content=urlTypes optionLabelPath='content.caption' selection=url_type}}
If there was a url_type
set for the model, it will be the selected option.
Upvotes: 1
Reputation: 47367
Looks like your logic is working just fine
http://emberjs.jsbin.com/nefas/12/edit
Upvotes: 0