title: Rails: How does session work in this situation?
body: <p>I am trying to pass values between actions in a controller. 
  When I puts values in the sender action it returns a collection of objects correctly. But when I puts values from the receiver action, it shows different thing.<br>
  I met this problem when I tried to use <code>each</code> to retrieve every object from collection</p>
  
  <p><strong>example_controller.rb</strong></p>
  
  <pre><code>def query
    @results = Result.all
    session[:results] = @results
    puts session[:results]
  end
  
  def print
    @receiver = session[:results]
    puts @receiver
  end
  </code></pre>
  
  <blockquote>
    <p>Results:0x007fdc8b96b0a8<br> Results:0x007fdc8b96af68<br>
    Results:0x007fdc8b96adb0<br> Results:0x007fdc8b96ac70<br></p>
    
    <p>{"id"=>9, "e_comp"=>"109", "e_num"=>"ccc"}<br> {"id"=>11,
    "e_comp"=>"111", "e_num"=>"bbb"}<br> {"id"=>12, "e_comp"=>"112",
    "e_num"=>"ddd"}<br> {"id"=>15, "e_comp"=>"115", "e_num"=>"kkk"}<br></p>
  </blockquote>
  
  <p>if I try <code>@receivers.each {|r| r.e_comp}</code> , it will show an error </p>
  
  <blockquote>
    <p>NoMethodError (undefined method `e_comp' for Hash:0x007fdc8b96b0a8)</p>
  </blockquote>
  
  <p>What happens inside rails? why session turn to another format?</p>