CODE:
routes.rb
Rails.application.routes.draw do
get "/movies" => "movies#index"
get "/movies/:id" => "movies#show", as: :movie
get "/actors" => "actors#index"
get "/actors/:id" => "actors#show", as: :actor
end
actors/index.html.erb
<div class="main actor-index">
<div class="container">
<div class="row">
<% @actors.each do |a| %>
<%= image_tag a.image %>
<h3> <%= a.first_name %> <%= a.last_name %> </h3>
<p> <%= link_to "Learn more", actor_path(a) %>
<% end %>
</div>
</div>
movies/index.html.erb
<div class="hero">
<div class="container">
<h2>Interstellar</h2>
<p>Former NASA pilot Cooper (Matthew McConaughey) and a team of researchers travel across the galaxy to find out which of three planets could be mankind's new home.</p>
<a href="#">Read More</a>
</div>
</div>
<div class="main">
<div class="container">
<h2>Popular Films</h2>
<% @movies.each do |movie| %>
<div class="movie">
<%= image_tag movie.image %>
<h3><%= movie.title %></h3>
<p><%= movie.release_year %></p>
<p><%= movie.plot %></p>
<%= link_to "Learn more", movie_path(movie) %>
</div>
<% end %>
</div>
</div>
ERROR MESSAGE:
Uploading…