title: Show View Returning Error: undefined method `each'
body: <p>I researched this topic here on Stack Overflow but I still can't seem to figure out what I'm doing wrong. </p>
  
  <p>My show.html view file is throwing this error:</p>
  
  <pre><code>undefined method `each' for #&lt;Advertisement:0x007fce42676a70&gt;
  </code></pre>
  
  <p>when I'm clicking on my individual ads within my browser locally.</p>
  
  <p><strong>My show.html view code:</strong></p>
  
  <pre><code>&lt;h1&gt;&lt;%= @advertisement.title %&gt;&lt;/h1&gt;
  
  &lt;%= link_to "Edit advertisement", edit_advertisement_path, class: 'btn btn-success' %&gt;
  &lt;%= link_to "Delete advertisement", @advertisement, method: :delete, class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete this advertisement?' } %&gt;
  
  &lt;div class="row"&gt;
    &lt;div class="col-md-8"&gt;
      &lt;p class="lead"&gt;&lt;%= @advertisement.copy %&gt;&lt;/p&gt;
      &lt;% @advertisement.each do |advertisement| %&gt;
      &lt;div class="media"&gt;
        &lt;div class="media-body"&gt;
          &lt;h4 class="media-heading"&gt;
            &lt;%= link_to advertisement.title, advertisement_path(@advertisement) %&gt;
          &lt;/h4&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
    &lt;/div&gt;
    &lt;div class="col-md-4"&gt;
      &lt;%= link_to "New Advertisement", new_advertisement_path(@advertisement), class: 'btn btn-success' %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>My advertisement controller code:</strong></p>
  
  <pre><code>class AdvertisementsController &lt; ApplicationController
    def index
      @advertisements = Advertisement.all
      # render('advertisements/index.html.erb')
    end
  
    def show
      # raise 'this is the show action'
      @advertisement = Advertisement.find(params[:id])
      # render 'advertisements/index.html.erb'
    end
  
    def edit
      @advertisement = Advertisement.find(params[:id])
    end
  
    def new
      @advertisement = Advertisement.new
    end
  
    def create
      @advertisement = Advertisement.new
      @advertisement.title = params[:advertisement][:title]
      @advertisement.copy = params[:advertisement][:copy]
      @advertisement.price = params[:advertisement][:price]
  
      if @advertisement.save
        flash[:notice] = "Advertisement was saved."
        redirect_to @advertisement
      else
        flash[:error] = "There was an error saving the advertisement. Please try again."
        render :new
      end
    end
  
    def update
      @advertisment = Advertisement.find(params[:id])
      @advertisment.title = params[:advertisement][:title]
      @advertisment.copy = params[:advertisement][:copy]
      @advertisment.price = params[:advertisement][:price]
  
      if @advertisement.save
        flash[:notice] = "Advertisement was updated."
        redirect_to @advertisement
      else
        flash[:error] = "Error saving advertisement. Please try again."
        render :new
      end
    end
  end
  </code></pre>
  
  <p>From researching it, I believe my issue is that the <code>advertisement</code> object has to be an array. What do I need to change to get the show view to work properly? Thanks in advance!</p>