Unknown_attribute tag_id


#1

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"><%=@tag.title%></h2>

    <div class="cards row">
            <%=@destinations.each do |d| %>
      <div class="card col-xs-4">
        <img src="<%=d.image%>">
        <h2><%=d.name%></h2>
        <p><%=d.description%></p>
      </div>
    </div>
  </div>
</div>

#2

@cloudplayer90178

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


#3

I have updated my question. Please have a look.

Regards


#4

@cloudplayer90178

This line

Should be like this

<%= d.image %>

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


#5

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?


#6

<%= image_tag d.image %>

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


#7

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


#8

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