When I use the form object pattern in rails, I include ActiveModel
and I tend to delegate attributes to an actual model.
Why would I want to use the virtus gem? Seems I'd be redefining attributes that are already defined elsewhere (i.e. a model)
When I use the form object pattern in rails, I include ActiveModel
and I tend to delegate attributes to an actual model.
Why would I want to use the virtus gem? Seems I'd be redefining attributes that are already defined elsewhere (i.e. a model)
You can define attribute types and default values in Virtus, which might make parsing the form a bit easier, especially for virtual attributes.