rubyflow.com
06 Nov '12, 10pm
A cleaner alternative to accepts_nested_attributes_for
A cleaner alternative to accepts_nested_attributes_for Posted by elight on November 06, 2012 — 2 comments Redtape provides an alternative to ActiveRecord::NestedAttributes#accepts_nested_attributes_for in the form of, well, a Form! The initial implementation was heavily inspired by "7 Ways to Decompose Fat Activerecord Models" by Bryan Helmkamp. Comments Really like the look of this. It is similar to something I have been thinking about for a while. Could this object do more than just assist in nested objects? A few thoughts: Would love for it to have a default implementation of populate for simple non-nested objects. This would just create an instance of the object being saved/validated and assign each accessor. Kind of an alternative to attr_protected or the new strong attributes. Would be nice if validation could also be placed at this form level. This way validatio...
Full article:
http://www.rubyflow.com/items/8456-a-cleaner-alternative-...