title: Rails 3 fields_for - sort order gets lost
body: <p>I am using Rails 3.0.3 with ruby 1.9.2p0.</p>
  
  <p>In my profiles_controller (edit function) I have this call </p>
  
  <pre><code>@profile = Profile.find(params[:id])
  @profile_items = @profile.profile_items.order("pos")
  </code></pre>
  
  <p>to get the @profile_items in the correct order, sorted on "pos".
  In the _form.html.erb I have the following</p>
  
  <pre><code>&lt;% @profile_items.each do |pi| %&gt;
    &lt;%= pi.pos %&gt; | 
  &lt;% end %&gt;
  &lt;%= f.fields_for :profile_items do |f2| %&gt;
    &lt;%= render 'profile_item_fields', :f =&gt; f2 %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The 3 first lines are test code to show that the @profile_items are in the correct order.
  But when they are rendered they have lost the sorted order!</p>
  
  <p>Now I have search a lot for an answer and I think this must be a common "trap" to
  fall into. </p>
  
  <p>Thankful for any help...</p>