4. Display all tags

Please some help.

unknown attribute: title

My code:

<div class="header">
  <div class="container">
    <img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1tm.svg" width="80">
    <h1>BokenjiKan</h1>
  </div>
</div>

<div class="tags">
  <div class="container">
    <div class="cards row">
 
  <% @tags.each do |t| %>
  	<div class="card col-xs-4">
	<%= image_tag t.image %>
	<h2> <%= t.title %> </h2>
  	</div>
  <% end %>

      <!--
      To do: Loop through tags and display each one with this HTML
      <div class="card col-xs-4">
        <img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1tm.svg" width="80">
        <h2> tag's title goes here </h2>
      </div>
      -->
    </div>
  </div>
</div>
<div class="header">
  <div class="container">
    <img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1tm.svg" width="80">
    <h1>BokenjiKan</h1>
  </div>
</div>

<div class="tags">
  <div class="container">
    <div class="cards row">
 
  <% @tags.each do |t| %>
  	<div class="card col-xs-4">
	<%= image_tag t.image %>
	<h2> <%= t.title %> </h2>
  	</div>
  <% end %>

      <!--
      To do: Loop through tags and display each one with this HTML
      <div class="card col-xs-4">
        <img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1tm.svg" width="80">
        <h2> tag's title goes here </h2>
      </div>
      -->
    </div>
  </div>
</div>

Hi José,

Could you please post a link to the exercise you’re on?

https://www.codecademy.com/en/courses/learn-rails/lessons/one-many/exercises/one-many-display-tags?action=resume

Hi,

I had a problem with “bundle”.

I needed to use:

bundle exec rake db:migrate
bundle exec rake db:seed

after this I used the same code and it worked.

Thanks!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.