title: RoR one-to-many association show view
body: <p>In my first Ruby on Rails app I've a one-to-many association</p>
  
  <pre><code>class Battle &lt; ActiveRecord::Base
      has_many :rivals, :dependent =&gt; :destroy
      accepts_nested_attributes_for :rivals, :allow_destroy =&gt; true
      attr_accessible :question, :rivals_attributes
  end
  
  class Rival &lt; ActiveRecord::Base
      belongs_to :battle
      has_attached_file :rival_image, :styles =&gt; { :normal =&gt; "300x300&gt;", :thumb =&gt; "100x100&gt;" }
  end
  </code></pre>
  
  <p>Let's say a battle has 2 rivals</p>
  
  <p><code>&lt;% for rival in @battle.rivals %&gt; &lt;%= rival.name %&gt; &lt;% end %&gt;</code> displays both rivals that belongs to battle</p>
  
  <p>How do I display first rival and the second one where I need it?</p>