RailsCasts Pro episodes are now free!

Learn more or hide this

Jeremy Gailor's Profile

GitHub User: JGailor

Site: http://www.infinitecube.com

Comments by Jeremy Gailor

Avatar

+1 as well. I don't see why the pattern requires validations to be moved out of the model. If the validation keeps the persisted form of the data consistent, it should be part of any interaction with the model. If it is a validation that acts only on the form data, then I can see moving it into the form object. The password form object was a good example of that.

There's a really excellent pattern here, specifically I am thinking of a complicated sign-up process that is part of a single-page app. If you want to have a user fill in form data that goes to several models, the form model abstraction is perfect. Just make sure that it operates at the proper level of abstraction.