Hello I have a little problem with creating one model and updating second model in one time.
I have two models: Works and Rooms. In Rooms model i have fields: roomId, roomname, area, is_completed, complete_year, complete_month. In Works model i have fields: id, type_of_work (for example painting), date_of_work, room_id. I would like to create a new work and have the ability to automatically set whether the room is marked as completed (in one form). I’ll just add that when I create a new work (create action), I don’t have immediately access to the room id, because it’s set by completing the form when a new work is added (from dropdown list). Can somebody help me with this? I know how to create a one form for two NEW models - but I do not know what to do in this particular situation - when one model is created but second exist:(
Thank you in advance for your help
Sorry for my english:(