Movie II 5.2

don’t know what’s wrong with this code after trying several thigs it’s always the same issue : error message

anyone to explain it to me ?

In the first line of show method you are using reference to @movies when in the second you use variable @movie without s at the end. Try this and check if it’s working out.

Hello Witekm

i’ve tried it during my several attemps to solve that problem and here is what i’ve got in response

Uploading…

Sorry
in the show action did you save a new movie object into the @movie variable ?

ok i’ve solved my last problem i just have to inversed ligne5 with line 6 but now i’ve got a new one :

any idea should be welcom

@je22 Line 7 needs to be inside def show ... end.

Hello Zystvan i 've founded it just before your reply now i’ve got an other problem just have a look at this screen shot its in the step 3

@je22 There is no @actors variable inside your loop through @actors. It needs to be actor instead :slight_smile:

thanks for your help Zystvan here is where i am now

by the way it’s late in the evening or early in the morning here so i will continue later

bye

@je22 Sorry, I didn’t explain properly.

Line 15 should look like this:

<% @actors.each do |actor| %>

Then, everything after that line and before the <% end %> will use just actor, without an at sign (@) prefixing it or an s at the end. So, it should look like this:

<% @actors.each do |actor| %>
  <%= image_tag actor.image %>
  <!-- ... -->
<% end %>

Does that make more sense? :slight_smile:

Hello Zystvan in deed it makes more sense but there still a problem and i’m getting nut with this part
:frowning:

here i’ve just removed the s at the end of @movies

:rage:

@je22 On line 4, change @movie to @movies.

that was one of the many many tinigs i’ve tried

@je22 OK, now could I see the code in app/controllers/movies_controller.rb?

there it is

i’ve just seen that a s was missin in @movie.actors i’ve corrected it but there’s no change

@je22 Oh, sorry - change the variable from @movies to @movie, both in your controller and HTML file. Then, inside your HTML file, remove the loop part and just show @movie.title (for example) and I think it should work then :slight_smile:

Sorry, I thought it was supposed to be @movies, didn’t mean to confuse you more :grimacing:

thanks so much for your help Zystvan but for the first time in all the courses i’ve made i gave up and ask for th code. there it is if it can help someone else

show.html.erb

movies_controller.rb

see you