Bulk create form

I currently have a phoenix form to create an invite. The form is connected to the create action on the Invite resource. The only field is email. I want to change the form to accept multiple email addresses--comma separated--and then create multiple invites. The create action currently generates a token and sends an email, so it's bit more complicated than a db insert. I haven't used manual actions, the new bulk_create feature, or Ash.Flow yet. I'm not sure which is the best route. I'm thinking of adding a manual bulk_create action to my resource that calls the existing create for each email address. Feedback?
1 Reply
ZachDaniel
ZachDaniel•2y ago
I think that is your best bet for now 🙂 At some point, I'd like to support the new "generic actions" in AshPhoenix.Form, since those can essentially do whatever you want I'd also like to support AshPhoenix.FlowForm at some point but until those things happen, a manual create action is a reasonable bet.

Did you find this page helpful?