@danmalone89 wrote:
// 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 eachfund
in astrategy
, when the user actuatesupdateStrategy
. What’s not clear is how to get the values from each{{input}}
and thefund.id
of eachfund
as well.
Posts: 1
Participants: 1