I would either add another create/2 or update/2 action in my controller, and use pattern matching…
Daniel Berkompas
41

Follow up question regarding RESTful API. I’ve seen a pattern where we have an elaborate create function for class A in the controller, the implementation details would do more than 1 thing (such as create class B and C first, add B to C then use C to create A, such and such).

Do you split those up to different functions or keep it that way and give an explicit name of the function (such DoElaborateCreate())?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.