Movies does not show up after clicking on an actor


I have passed every instruction but in the end when I click on the link "learn more" the details of actor shows up but not the the movies that actor is a part of, what am i doing wrong? The code of show.html.erb for Actor is given below-

<!-- Display an actor's info here -->
<div class="actor">
  <%= image_tag @actor.image %>
  <div class="info">
    <h3 class="actor-name"> <%= @actor.first_name %> <%= @actor.last_name %></h3>
    <p class="actor-bio"> <%= %> </p>

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

the code for actors_controller.rb is -
class ActorsController < ApplicationController
def index
@actors = Actor.all

def show
@actor = Actor.find(params[:id])
@movies = @actor.movies

Any help would be appreciated !

Actors showing up more than once and some links show the movies while some don't

Are You sure? The movies should be written below information about an actor. In small window You must scroll the page down.
I write about it because I thought also that I had made something wrong… :smile: