title: returning an array of objects in rails
body: <p>I need to pass an array of mailobjects from my rails mailer class to the corresponding controller which i thought should work if i just do</p>
  
  <pre><code>class foo &lt; Actionmailer::Base
  
      def bar(...)
          mails_array = Array.new
          return mails_array
      end
  </code></pre>
  
  <p>but as the controller gets <code>mails_array</code> via</p>
  
  <pre><code>@mails = Array.new
  @mails.concat(foo.bar(...))
  </code></pre>
  
  <p>i get a:</p>
  
  <blockquote>
    <p>TypeError in mailsController#index<br>
    can't convert Mail::Message into Array</p>
  </blockquote>
  
  <p>did i miss something??
  I would expect to have the mails_array in mails and can't understand why it is not.</p>