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
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> <div class="col-md-9"> <p class="title"><% book.title %> </p> <p class="author">by <% book.author %> </p> <p class="publisher">(<% book.publisher %> )</p> <p class="description"><% book.description %> </p> <%= link_to 'See all Editorial Reviews', book %> </div> <div class="col-md-2"> <p class="weeks-on-list"> <% book.weeks_on_list %>weeks on list</p> </div> </div> </div>
<% end %>
Link to the project:
https://www.codecademy.com/courses/learn-rails/projects/learn-rails_bookmarks
@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
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.