There are FundApplication and ExpenseRequest, FundApplication has_many expense_requests.
Pressing the 'Add Expense' Button will add expense requests and is working fine. Now my client asks me to implement a copy button here
What he wants is to add a button that inserts a new expense request but copy's the expense request's data the button belongs into the fields of newly created expense_request
I tried How to create a copy of item added in cocoon nsted form rails? How could I clone a child object in Rails using cocoon?
None of them worked for my scenario.