Ruby on Rails, Associations I, 4/9, Q.4!

I want to ask "How can I know what words must be filled in after <div class ?
I mean the place exactly “card col-xs-4” is in.

Is it must to write “Card col-xs-4” to show title and image?
Or just this codecademy exercise use the name?

Thank your help:)

Please check the question and answer code below

In app/views/tags/index.html.erb at line 12, iterate through each tag in the @tags array. Then for each tag, display its title and image.

We’ve provided CSS in app/assets/stylesheets/application.css.

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

Hi @jiinlim,

The card class is provided by Codecademy for styling, so each tag will look pretty. Codecademy also uses Bootstrap in it’s exercises, so they don’t have to code basic layout styles over and over again, and Bootstrap uses the col-xs-4 class to style it as a column inside that row.

1 Like

Thank you!!!

I couldn’t realize there are comments.

Also thank you for giving me the information regarding bootstrap.


1 Like

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