4. Display all tags


#1

Please some help.

"unknown attribute: title"

"My code:




BokenjiKan





<% @tags.each do |t| %>


<%= image_tag t.image %>

<%= t.title %>



<% 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>

"


#2

<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>

#3

Hi José,

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


#4

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


#5

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!


#6

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