In Phoenix generally all the pages for create, update and edit are shown different. We pass the data to the template based on the action a user want to perform.
To list all entities we use render as:
render(conn, "index.html", refunds: refunds)
And to create entity we pass changeset:
render(conn, "new.html", changeset: changeset)
I want to show the create/edit for on same page where all entity are listed as follows:
How can this be achieved in single template as both actions need different struct while using render?