title: Seed - How reinitialize my seed - rails
body: <p>Hi I create this seed </p>
  
  <pre><code>rails = Course.create(title: "Ruby On Rails")
  models = rails.chapters.create(title: "Models")
  
  models.items &lt;&lt; Lesson.create(title: "What is Active Record?", content: "Lesson content here")
  
  models.items &lt;&lt; Exercice.create(title: "The Active Record pattern", content: "Exo about active record pattern")
  models.items &lt;&lt; Exercice.create(title: "Object Relational Mapping", content: "Exo about ORM")
  models.items &lt;&lt; Exercice.create(title: "Active Record as an ORM Framework", content: "Exo about ORM")
  
  models.items &lt;&lt; Lesson.create(title: "Convention over Configuration in Active Record", content: "Lesson content here")
  
  models.items &lt;&lt; Exercice.create(title: "Naming Conventions", content: "Exo about naming convention")
  models.items &lt;&lt; Exercice.create(title: "Schema Conventions", content: "Exo about schema convention")
  
  models.items &lt;&lt; Lesson.create(title: "Model summary", content: "Lesson content here")
  
  models.items &lt;&lt; Exam.create(title: "Rails Models exam", content: "Exam content here")
  
  puts "done"
  </code></pre>
  
  <p>I have done <code>rake db:seed</code>. </p>
  
  <p>My controller Course is:</p>
  
  <p>class CoursesController &lt; ApplicationController</p>
  
  <pre><code>  def index
      @courses = Course.all
    end
  
    def show
      @course = Course.find(params[:id])
    end
  
  end
  </code></pre>
  
  <p>My controller Chapter is :</p>
  
  <p>class ChaptersController &lt; ApplicationController</p>
  
  <pre><code>  def show
      @course = Course.find(params[:course_id])
      @chapter = @course.chapters.find(params[:id])
    end
  
  end
  </code></pre>
  
  <p>My controller Chapter is :</p>
  
  <pre><code>class ItemsController &lt; ApplicationController
  
    def show
      @course = Course.find(params[:course_id])
      @chapter = @course.chapters.find(params[:chapter_id])
      @item = @chapter.items.find(params[:id])
    end
  end
  </code></pre>
  
  <p>And in the app/views/courses/index.html.erb</p>
  
  <pre><code>&lt;div class="container-page"&gt;
    &lt;div class="padding-page"&gt;
      &lt;div class="container-fluid"&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-xs-12 col-sm-12 col-md-12"&gt;
            &lt;div class="page-progress"&gt;
              &lt;h1&gt;
                Page en cours de réalisation
              &lt;/h1&gt;
  
              &lt;% @courses.each do |course| %&gt;
              &lt;h2&gt;
              &lt;%= link_to course.title, course %&gt;
  
              &lt;/h2&gt;
              &lt;% end %&gt;
  
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But it appears title courses numerous times and I want to have just see one time. How do I reset or destroy or hide the others courses wjich name the same Name and have the same structure? </p>
  
  <p><a href="http://i.stack.imgur.com/SCdbu.png" rel="nofollow">Here is the index iteration</a></p>
  
  <p>If you want more informations I give you but tell me what can I do. Thank you.</p>