Show tags


#1

How do you do this:
In app/views/tags/show.html.erb inside the < h2> element, display a tag's title.

Then in < div class="cards">...< /div>, iterate through each destination in the @destinations array and display its image, name, and description.

What's wrong with my code:

 <div class="card col-xs-4">
    <%= destination.image %>
    <h2><% = destination.name %> </h2>
    <p><% = destination.description %>  </p>
  </div>
	<% end %>
</div>


#2

Could it be the white space?

<%= ... %>

#3

It's still not working

  <% @destinations.each do |d| %>
  <div class="card col-xs-4">
    <%= image_destination d.image%>
    <h2> <%= d.name %> </h2>
    <p> <%= d.desription%> </p>
  </div>
<% end %>

</div>


#4

Should this read, image_tag?


#5

it still gives an error


#6

Please show us the entire file. Thanks.


#7

<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">  </h2>

    <div class="cards row">

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

    </div>

  </div>
</div>

#8

Is this Step 4 of lesson 6?

https://www.codecademy.com/en/courses/learn-rails/lessons/one-many/exercises/one-many-show-destination


#9

its Associations I
5. Show tags
instruction 3


#10

Still need to change this. Be sure to Run after changing.

Should read,

<%= image_tag d.image %>

#11

You should replace the <h1>BokenjiKan</h1> with the tag's title.


#12

I'm sorry but I don't see what this has to do with Lesson 5, Step 3. How is this helpful?


#13

in ruby rail!!!!!!!!!!!


#14

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