Error in Movies II 5/3


#1

Hello. I don't undestand what's wrong here. The program doesn't give me any error mistake.
Can anybody help me?

This is show.html.erb



  <!-- Display the movie's info here -->
  <div class="info">
    <!-- movie image -->
    <%= @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>
  </div>
</div>

<h2>Cast</h2>
 <% @actors.each do |a| %> 
<!-- Display each actor's info here -->
<div class="actor">
  <!-- actor image -->
  <%= a.image %>
  <h3 class="actor-name"> <%= a.first_name %> <%= a.last_name %> </h3>
  <p class="actor-bio"><%= a.bio %>  </p>
</div>

And this is movie's controller

class MoviesController < ApplicationController
def index
@movies = Movie.all
end

def show
@movie = Movie.find(params[:id])
@actors = @movie.actor
end
end

Thanks.


#2

Hi Artur,

Your code looks fine to me, although you should use <%= image_tag @movie.image %> to show the movie's picture instead.

There's a bug right now which seems to be failing people for no reason, even when they have the correct code, and I think that's what's causing you to not be passed right now. Could you try waiting a few days, then come back to this exercise and see if it's working then?

Some people also say resetting the exercise works for them.


#3

Hi Zystvan,

Thanks for help. Ok, I can wait a few days, it's not a problem.


#4

Hi Zystvan,

You didn't forget about me, did you? :slight_smile:
My code is still not correct.


#5

Hey, I saw your code and it worked for me. Not sure if you included this but try adding the <% end %> I hope it helps!

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


#6

@arturgudiev No, I didn't forget :slight_smile:

Does @sitra_achra's suggestion work for you?


#7

Hello,

Yes, it works!!
Thank you! =)


#8

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