小编sam*_*319的帖子

haml文件中的Ruby语法错误

我收到以下错误:

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
Run Code Online (Sandbox Code Playgroud)

以下是错误来自的代码:

%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)
Run Code Online (Sandbox Code Playgroud)

我不确定我需要在哪里进行更改,因此这两个错误不再弹出.

ruby haml ruby-on-rails

0
推荐指数
1
解决办法
111
查看次数

标签 统计

haml ×1

ruby ×1

ruby-on-rails ×1