I always have the the trouble in determining whether I should put business logic regarding user inputs in model or form, especially for simple business rules. Say I have a Product class, and a business rule is that its price (an attribute of Product) cannot exceed $1000. Do I put the validation at the model or the form level? What are the criteria you use to determine such?
Share
Can it never go above $1000? Then put the validation in the model.
A reason to put the validation in the form is if you want your users to enter a price below $1000 most of the time, but occasionally an administrator may enter a higher price through a different view.