こんにちは、haml を erb に変換しようとしていますが、どこが間違っているのかわかりません。以下は私の HAML コードです。
%h1 All Movies
%table#movies
%thead
%tr
%th{:class => ('hilite' if @sort == 'title') }
= link_to 'Movie Title', movies_path(:sort_param => 'title'), :id => 'title_header'
%th{:class => ('hilite' if @sort == 'release_date') }
= link_to 'Release Date', movies_path(:sort_param => 'release_date'), :id=> 'release_date_header'
%th Release Date
%th More Info
%th Edit 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)
%td= link_to "Edit Movie", edit_movie_path(movie)
= link_to 'ADD NEW MOVIE', new_movie_path
以下は私のerbコードです
<h1> All Movies </h1>
<table id='movies'>
<thead>
<tr>
<th class ='hilite'><%= if @sort == 'title'
link_to movies_path(:sort_param => 'title'), :id => 'title_header'
end %></th>
<th class = 'hilite'><%=if @sort == 'release_date'
link_to movies_path(:sort_param => 'release_date'), :id=> 'release_date_header' end %> </th>
<th> Release Date </th>
<th> More Info </th>
<th> Edit Info </th>
</tr>
</thead>
<tbody>
<%= @movies.each do |movie| %>
<tr>
<td><%= movie.title %> </td>
<td><%= movie.rating %> </td>
<td><%= movie.release_date %> </td>
<td><%= link_to "More about #{movie.title}", movie_path(movie) %>
<td><%= link_to "Edit Movie", edit_movie_path(movie) %></td>
</tr>
<%= end %>
<%= link_to 'ADD NEW MOVIE', new_movie_path %>
</tbody>
</table>
これは私が得ているエラーです、
appname/app/views/movies/index.html.erb:25: syntax error, unexpected keyword_end
');@output_buffer.append= ( end );@output_buffer.safe_concat('
^
appname/app/views/movies/index.html.erb:30: syntax error, unexpected keyword_ensure, expecting ')'
appname/app/views/movies/index.html.erb:32: syntax error, unexpected keyword_end, expecting ')'