// fund model (each fund record belongs to 1 strategy record)
export default DS.Model.extend({
fund: belongsTo('available-fund'),
weight: DS.attr('number'),
strategy: belongsTo('strategy'),
});
And this form.hbs
{{input type="text" class="form-control" required=true value=strategy.strategyName}}
{{#each strategy.strategyFunds as |fund|}}
<tr>
<td>Fund Weight: {{input type="text" class="form-control" value=fund.weight}}</td>
</tr>
{{/each}}
`<button type="button" class="btn btn-info mr-2" {{action 'updateStrategy' strategy}} >Save Strategy Changes</button>`
This is my action when the user clicks save, for now.
updateStrategy(strategy) {
strategy.save()
}
I want the user to be able to save the fund.weight
value of each fund
in a strategy
, when the user actuates updateStrategy
. What’s not clear is how to get the values from each {{input}}
and the fund.id
of each fund
as well.