I'm trying to go through step 5.4 where we are about to just add line to link specific movie from index view with designed view created on show.erb.html template.
I am constantly getting this error: Did you add link for movie?
when my code in index.erb.html file looks like:
<% @movies.each do |m| %>
<img src=<%= 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>
<%= link_to 'Learn more', movie_path(m) %>
<% end %>
Movies controller has following code:
class MoviesController < ApplicationController
@movies = Movie.all
@movie = Movie.find(params[:id])
@actors = @movie.actors.all
and routes.rb also looks fine for me:
get '/movies' => 'movies#index'
get '/movies/:id' => 'movies#show', as: :movie
Does anyone see what I did wrong or why am I getting this kind of error message?