Unknown_attribute tag_id

I have completed first two steps in ‘Show a Tag’ section. But when I try to evaluate 3rd step, it is showing error message. ‘Unknown attribute tag_id’.

Here is my code for show.html.erb

<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="tag">
  <div class="container">
    <h2 class="tag-title"><%[email protected]%></h2>

    <div class="cards row">
            <%[email protected] do |d| %>
      <div class="card col-xs-4">
        <img src="<%=d.image%>">
        <h2><%=d.name%></h2>
        <p><%=d.description%></p>
      </div>
    </div>
  </div>
</div>

@cloudplayer90178

Can we have the code for app/views/tags/show.html.erb ?

I have updated my question. Please have a look.

Regards

@cloudplayer90178

This line

Should be like this

<%= d.image %>

We won’t need to use img tag in this case.

1 Like

That did n’t help. It is still reporting same error. Btw, why don’t we need img tag in this case? Image location is stored as string. How rails will interpret it as an image?

<%= image_tag d.image %>

is how the line should be. image_tag is a built in thing that comes with Rails.

2 posts were split to a new topic: What i do wrong here?

A post was merged into an existing topic: What i do wrong here?