RailsCasts Pro episodes are now free!

Learn more or hide this

Corey Ward's Profile

GitHub User: coreyward

Site: http://coreyward.me/

Comments by Corey Ward

Avatar

I immediately cringed when I saw you eschewing the built-in ActiveModel::Validations validators for a custom validate_properties method. Then when your solution to allowing a more complex field to be added was to hard code it I lost all faith.

I actually had to do something similar about a year ago for a project collecting electronic signatures for forms. To meet my needs I used a dynamically defined proxy object that would allow the use of any built in validators on any of the attributes, then passed that to the form builder. I'd love to see this thought through better, but it already more effectively re-uses components that have already been built and tested.