Hello!
One probably silly question:
Is it possible to have an Action for a data type that isn’t a model? I have a few models:
Exercise
MuscleGroup
ExercisesMuscleGroup
(link table between the two above, it is a many-to-many relationshit).
Ideally, I’d like to submit a form that would create an Exercise
, and also create the relevant rows in the ExercisesMuscleGroup
link table.
I can do this all manually by passing in a custom param
but I wanted to see if I could leverage the type system to do this kind of work for me.
Does anyone have any tips on how to approach this in a nice manner? I’ve tried a few approaches and it seems like they pull me very much out of my depth.
You can see the PR where I’m attempting this here.
I would also like to mention that this has been by far the most fun I’ve had playing around with types!
I’ve never really had a reason to, but now, I find I am learning a LOT!
Thank you for the great work,
Nuno