Really up to you...
What you have to have in mind when choosing one way or the other is:
for a)
- the dealer that the review is related to will already be created? If not, how will you add the foreign key dealer_id to DealerReviews to relate both?
for b)
- this will nullify the trouble of not having a proper foreign key if the dealer is not created (of course, if you add the creation of dealer first)
- you cannot reuse the add DealerReviews logic if you plan to add reviews from somewhere else.
What I normally do is just post the data directly to the main controller (in this case Dealers). Saves me the trouble of having to check if the Dealer was correctly saved and validated before adding the Review.
If there's a business logic to have in mind before saving the Review (like it can only be save between 2am and 3am (stupid example, I know)), then I add that validation in beforeSave
.
If it is a one-or-two-in-a-time business logic, I create a new function saveButOnlyInSomeCasesLogic($reviewArray)
in the model and let that handle those cases, the controller just calls that function and waits for the result.
In summary: choose the option that let you reuse code if you need to. If you will always have the foreign key available, do it in the Reviews controller, you may need to reuse the add action. If you will absolutely not reuse the add action or don't have the foreign key available when saving, to it in Dealers, keeping saving logic in the model if any.