In my application I have fields like tax_1_amount, tax_2_amount, tax_3_amount, invoice_amount and total_invoice_amount. When the total invoice amount is calculated then the amount_in_words field should be automatically updated by the total amount in words. Total amount is calculated as follows:
@total_tax_amount = @invoice.tax_1_amount + @invoice.tax_2_amount + @invoice.tax_3_amount
@total_amount = @total_tax_amount + @invoice.invoice_amount
Can anyone tell me if there is any generator or any gem for that. Or what code shall I write for that.