title: In js.erb ,how to use the array that defined in the rails controller?
body: <p>My code is as follows:</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>@snf1_ie_cases = Snf1Testcase.find(:all,:conditions=&gt;["result_style = ?", 0])
  
  respond_to do|format|
    format.js 
  end
  </code></pre>
  
  <p><strong>XX.js.erb:</strong></p>
  
  <pre><code>&lt;% for snf1_ie_case in @snf1_ie_cases %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Then the error is:</p>
  
  <blockquote>
    <p>undefined method 'each' </p>
  </blockquote>
  
  <p>How can I send the array of the controller to XX.js.erb?</p>