Rails 4、ルビー 2.0。各ファイルのダウンロード リンクと、チェックボックスと [チェックしたファイルをダウンロード] ボタンを使用して複数のファイルのダウンロードをチェックできる公開ファイル サービス ページを作成したいと考えています。
index.html.erb の私のコード
<% form_tag(controller: "files", action: "download_many", method: "get")%>
<h1>St.Catherines</h1>
<ul>
<% @stcatherines.each do |file|%>
<li><%= link_to file, :action => "download", :name =>file %></li>
<%check_box_tag(file)%>
<%end%>
<%submit_tag :value => "Download checked files" %>
</ul>
<%end%>
@stcatherines は文字列の配列です。ダウンロード リンクは機能しますが、フォームに何か問題があるはずです。私は奇妙なエラーで立ち往生しています:
.../app/views/files/index.html.erb:11:
syntax error, unexpected keyword_ensure, expecting end-of-input
構文エラーは 11 行目で発生し、コードは 10 行しかないことに注意してください。