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| %>/><% end %>
<%= m.title %>
<%= m.release_year %>
<%= m.plot %><%= link_to 'Learn more', movie_path(m) %>
Movies controller has following code:
class MoviesController < ApplicationController def index @movies = Movie.all end def show @movie = Movie.find(params[:id]) @actors = @movie.actors.all end private def movie_params params.required(:movie).permit(:id) end end
and routes.rb also looks fine for me:
Rails.application.routes.draw do get '/movies' => 'movies#index' get '/movies/:id' => 'movies#show', as: :movie end
Does anyone see what I did wrong or why am I getting this kind of error message?