Ash FrameworkAF
Ash Framework3y ago
8 replies
waseigo

Example of :create action with simultaneous assignment of relationship

Perhaps I'm too influenced by Django, but I've been trying to :create a new instance of a resource that belongs_to two other resource types by passing the other resources' .id values as parameters in the map, to no avail.

Following the Getting Started guide, I understand how I first create the Ticket resource instance and a Representative resource instance and then use the :assign update action to assign the ticket to the representative.

However, how would I go about creating a ticket with the representative already being assigned during the
:create
action?

If this is possible, what would it look like if I were to create a ticket with more than one related resources at once?

Or do I first need to create, then update/assign?
Was this page helpful?