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.
zystvan
September 1, 2016, 6:13pm
#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.
Hi Zystvan,
Thanks for help. Ok, I can wait a few days, it’s not a problem.
1 Like
Hi Zystvan,
You didn’t forget about me, did you?
My code is still not correct.
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 %>
2 Likes
zystvan
September 8, 2016, 12:49pm
#6
@arturgudiev No, I didn’t forget
Does @sitra_achra ’s suggestion work for you?
1 Like
zystvan:
D
Hello,
Yes, it works!!
Thank you! =)
1 Like
zystvan
closed
September 9, 2016, 5:15pm
#8
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.