Movies || 3/5

in this part of the module: In app/view/movies/show.html.erb

  • Inside <div class="movie">...</div> , display the movie’s image, title, release year, and plot.
  • Below <h2>Cast</h2> , iterate through each actor and display the image, first name, last name, and bio.
<div class="main movie-show">
  <div class="container">
    <div class="movie">
      <!-- Display the movie's info here -->
      <div class="info">
        <!-- movie image -->
        <%[email protected]%>
        <h3 class="movie-title"><%[email protected]%>  </h3>
        <p class="movie-release-year">  <%[email protected]_year%></p>
        <p class="movie-plot">  <%[email protected]%></p>

    <!-- Display each actor's info here -->
    <div class="actor">
      <%@actors.each do |a|%>
      <!-- actor image -->
      <h3 class="actor-name"> <%=a.first_name%><%=a.last_name%> </h3>
      <p class="actor-bio"> <> </p>


the error says : undefined method `name’ for nil:NilClass
what am I doing wrong