Bookmarks 15/16

I get no error message.
However, the browser preview shows up, but all by ERB fields are left blank.
I checked through the console, and my database does contain data…
What is going on?

Hi Julie,

Please post your code, a link to the exercise, and a screenshot of the entire window so we can help you :slight_smile:

Code of the index file :

<% @books.each do |book| %>
<div class="book">
 <div class="row">
 <div class="col-md-1">
    <p class="rank-this-week"> <% book.rank_this_week %></p>
  <div class="col-md-9">
    <p class="title"><% book.title %>  </p>
    <p class="author">by <% %> </p>
    <p class="publisher">(<% book.publisher %> )</p>
    <p class="description"><% book.description %>  </p>
    <%= link_to 'See all Editorial Reviews', book %>
  <div class="col-md-2">
    <p class="weeks-on-list">  <% book.weeks_on_list %>weeks on list</p>

<% end %>

Link to the project:

@lunargent <% ... %> indicates a piece of Ruby code to execute. <%= ... %> indicates a piece of Ruby code that will be output to the page. So, for things like loops or if statements, you shouldn’t use the equal sign (=), but for things like the book’s title, rank, author, etc., you do need it :slight_smile:

1 Like

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