2017-01-31 10 views
0

私は取得しています、次のエラー:私は私がする必要がどこかわからないRubyの構文エラー

%h1 All Movies 
%table#movies 
%thead 
    %tr 
     %th Movie Title 
     %th Rating 
     %th Release 
     %th More info 
    %tbody 
    - @movies.each do |movie| 
    %tr 
     %td= movie.title 
     %td= movie.rating 
     %td= movie.release_date 
     %td= link_to "More about #{movie.title}",movie_path(movie) 

:ここ

app/views/movies/index.html.haml:17: syntax error, unexpected keyword_ensure, expecting keyword_end 

app/views/movies/index.html.haml:20: syntax error, unexpected end-of-input, expecting keyword_end 

がエラーから来ているコードですこれらの2つのエラーがポップアップを停止するように変更してください。

答えて

5

これは簡単な修正です。下線をインデントします。- @movies.each do |movie|

- @movies.each do |movie| 
    %tr 
     %td= movie.title 
     %td= movie.rating 
     %td= movie.release_date 
     %td= link_to "More about #{movie.title}",movie_path(movie)