title: Ruby on Rails 4. Can i pass objects through flash scope
body: <p>I have a controller and need to pass objects which validation fail to another controller action to process them and show to user:</p>
  
  <pre><code>class PersonController
      def save_persons
          invalid_persons = ... #array of Person.new objects
          flash[:invalid_persons] = invalid_persons
          redirect_to action: :fix_errors
      end
      def fix_errors
          invalid_persons = flash[:invalid_persons]
          invalid_persons.each do |invalid_person|
              puts invalid_person.errors #here i get exception!
          end
      end
  end
  </code></pre>
  
  <p>When i try to   <code>puts invalid_person.errors</code> i get error: <code>undefined method errors for #Hash:0x007fd594e79098&gt;</code>. It seems that rails transform my objects array to some hash</p>
  
  <p>Can you suggest me, what is the right way to pass some object through flash?</p>