I am wanting to use Javascript to insert values into an option_to_select for rails.
My Javascript function is not doing it. Here it is.
function populateGlobalDonorClaimPhase() {
var donor_claim_phase = $('[id^=phase-table-row]').size();
$('#payer_contract_donor_claim_phase').val(donor_claim_phase);
}
this is able to fill the field when it is f.text_field, but it does nothing with f.select, in other words option_for_select.
= f.select :donor_claim_phase, options_for_select(@donor_claim_phase, @selected_donor_claim_phase)
How can I correctly insert these values into @donor_claim_phase
?
I have @selected_donor_claim
defaulted to a value, so that is not the problem. It's just correctly filling @donor_claim_phase
values.