Ash FrameworkAF
Ash Framework3y ago
13 replies
Terryble

Where and how do I write my business logic?

I know this is a silly question and I apologize as I'm still new to Ash, but where exactly do I write my business logic?

I have a Book and Category resource. What I want to happen is to create a bunch of Category records every time a Book is created.

Normally, I would write this business logic in a context/module somewhere and then call it inside the save handle_event in my liveview after a successful Book record creation.

I honestly can't figure out if I should just do the same thing - write a module somewhere in the app and call it once AshPhoenix.Form.submit() succeeds. Or maybe there is a convention or an actual methodology when doing these things with Ash and AshPhoenix?
Was this page helpful?