I'm building a small business app. There's a Sales table and Cars and Clients tables that are referenced by it with (car_id, client_id)
Now in the view where I create a Sale you can select an existing car and client from dropdowns. These don't display the actual objects but a property of that the capacity for cars and name for clients.
How do you deal with the initial nonexistence of the objects. If the user hasn't created a car or client, setting the dropdowns to display client.name and car.capacity results in an exception (nil doesn't have the method name or capacity)
It works after you start adding clients or cars but produces an error until that point.