title: Sort association models in Rails 3?
body: <p>Menu has_many :dishes.</p>
  
  <p>I want to sort the dishes by Dish.number.</p>
  
  <p>Currently in my view it looks like:</p>
  
  <pre><code>&lt;table class="menu"&gt;
    &lt;% @menu.dishes.each do |dish| %&gt;
      &lt;div class="dish"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            &lt;div class="dish_div dish_name"&gt;
              &lt;% if @menu.name != 'Övrigt' &amp;&amp; @menu.name != 'Box to go' %&gt;
                &lt;span class="dish_name"&gt;&lt;%= "#{dish.number}. #{dish.name}" %&gt;&lt;/span&gt;
              &lt;% else %&gt;
                &lt;span class="dish_name"&gt;&lt;%= "#{dish.name}" %&gt;&lt;/span&gt;
              &lt;% end %&gt;
  
              &lt;% if dish.strength_id == 2 %&gt;
                &lt;%= image_tag('chili.png') %&gt;
              &lt;% elsif dish.strength_id == 3 %&gt;
                &lt;%= image_tag('chili.png') %&gt;
                &lt;%= image_tag('chili.png') %&gt;
              &lt;% elsif dish.strength_id == 4 %&gt;
                &lt;%= image_tag('chili.png') %&gt;
                &lt;%= image_tag('chili.png') %&gt;
                &lt;%= image_tag('chili.png') %&gt;
              &lt;% end %&gt;
            &lt;/div&gt;
            &lt;div class="dish_div"&gt;&lt;%= "#{dish.description}" %&gt;&lt;/div&gt;
            &lt;div class="dish_div dish_price"&gt;&lt;%= "#{dish.price} kr" %&gt;&lt;/div&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>How do I do that?</p>
  
  <p>Should it be in the view or controller?</p>
  
  <p>Thanks</p>