Incorrect return

Asked

Viewed 36 times

2

Good evening, I’m having a problem pulling the bank information and display in the show.

A imagem abaixo esta o erro

my code is like this:

<%= @question.answers.each do |answer| %>
    <div class="media">
      <div class="media-left">
        <a href="#">
          <img class="media-object" src="<%= answer.gravatar %>">
        </a>
      </div>
      <div class="media-body">
        <h4 class="media-heading"><%= answer.email %> answered:</h4>
        <%= answer.body %>
      </div>
    </div>
  </div>
  <% end %>

Thank you guys.

1 answer

1


The sign of equal <%= serves to validate and print information, which in this case is the object you are iterating (Answer). Just try to validate the expression by changing from

<%= @question.answers.each do |answer| %>

for

<% @question.answers.each do |answer| %>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.