Actors 1


#1

What is wrong with this code???

<div class="main actor-show">
  <div class="container">
     <% @actors.each do |actor| %>
         <div class="actor">
            <%= image_tag actor.image %>
  <h3 class="actor-name"><%=actor.first_name%>, <%=actor.last_name %></h3>
  </div> 
  

    <h2>Movies</h2>
<% @movies.each do |movie| %>
    <div class="movie">
      <%= image_tag movie.image %>
      <h3 class="movie-title"> <%=movie.title%></h3> 
      <p class="movie-release-year> <%=movie.release_year %> </p>
      </div>
     </div>
  </div>

   <% end %>

#3

Hi Lsivak,

I've formatted your code for you, please format it yourself in the future, though :)
You seem to have an unclosed quote (") on <p class="movie-release-year"> - syntax highlighting is really helpful for spotting errors like this :)


#4

how would you do the syntax highlighting?
Cheers


#5

@ssjgork Sorry for the slow reply.
For on here, the forums, take a look at

For in a code editor, it'll usually be under preferences somewhere. Most code editors have it enabled by default, though :)


#7

I had some trouble with this exercise as well. The answer below is what populates when you request the code. Comparing with your original @lsivak it looks like they didn't loop through the actors, instead just opting to use the @ reference notation.



<%= image_tag @actor.image %>

<%= @actor.first_name + " " + @actor.last_name %>


<%= @actor.bio %>



<h2>Movies</h2>
<% @movies.each do |movie| %>
<div class="movie">
  <%= image_tag movie.image %>
  <h3 class="movie-title"><%= movie.title %></h3>
  <p class="movie-release-year"><%= movie.release_year %></p>
  <p class="movie-plot"><%= movie.plot %></p>
</div>
<% end %>

#8