4/9 Did you display each tag?


Hello everyone,

I don't know what's wrong with my code but I keep getting "In the view, did you display each tag?" error.

This is what I added:

<% @tags.each do |tag| %>
      <div class="card col-xs-4">
          <% image_tag tag.image %>
        <h2> <% tag.title %> </h2> 


Hi @netrunner21433,

<% ... %> indicates Ruby code to be executed, while <%= ... %> indicates Ruby code to bu output to the screen. Try using an equal sign (=) for the tag's image and title, like this:

<%= image_tag tag.image %>
<h2><%= tag.title %></h2>


It worked! Thank you.


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