title: How do I use serialize for an array attribute in a class using ActiveModel::Model?
body: <p>I'm using a tableless model to create a form. I want to set one of the model attributes as an array</p>
  
  <p>I know the following code doesn't work, but just showing what I want to do:</p>
  
  <p>Model:</p>
  
  <pre><code>class Quote
    include ActiveModel::Model
    include ActiveModel::Serialization
  
    attr_accessor :name, :length, :width, :city
    serialize :quantity, Array
  end
  </code></pre>
  
  <p>Then reference in the form using:</p>
  
  <pre><code>f.text_field :quantity, multiple: true, class: 'form-control', type: 'number'
  f.text_field :quantity, multiple: true, class: 'form-control', type: 'number'
  </code></pre>
  
  <p>How can I go about achieving this? Thank you.</p>