Why use virtus with rails form objects?

629 views Asked by At

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)

1

There are 1 answers

0
marcindobry On

You can define attribute types and default values in Virtus, which might make parsing the form a bit easier, especially for virtual attributes.