Movies II 5/7


Hello guys, in instruction nº 3 , im getting this error : undefined method `name' for nil:NilClass , and i'm not really understanding why, since i dont have any method (i guess that is what i can call it) related to actor nor movie called "name"

Here is my code related to step 3

<div class="main movie-show">
  <div class="container">
    <div class="movie">
      <!-- Display the movie's info here -->
      <div class="info">
        <%= 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>

    <% @actors.each do |actor| %>
    <div class="actor">
      <%= image_tag actor.image %>
      <h3 class="actor-name"><%= actor.first_name %> <%= actor.last_name %></h3>
      <p class="actor-bio"><%= %></p>
		<% end %>

Help is appreciated :smile:


Rails should give you the lines of your code where error occured. Can you copy it?


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