【发布时间】:2013-07-18 05:36:56
【问题描述】:
<h1>Get Ready</h1>
<% if params[:ballot_position].to_i > 1 %>
<p>
Voter <%= params[:ballot_position].to_i - 1 %>, go get voter <%= params[:ballot_position] %>
and switch places with them.
</p>
<p>
Voter <%= params[:ballot_position] %>, when you are ready, click the button marked "Ready" below.
</p>
<% @ballot_link = "/vote/#{params[:election_id]}/ballot/#{params[:ballot_position]}" %>
<a href="<%= @ballot_link %>" class="btn btn-primary">Ready</a>
上面的代码似乎导致:
ready.html.erb:13: syntax error, unexpected keyword_ensure, expecting keyword_end
ready.html.erb:15: syntax error, unexpected $end, expecting keyword_end
发生了什么事?这个语法有什么问题?
【问题讨论】:
-
您发布了文件的第 10 行和第 11 行,而错误引用了第 13 行和第 15 行。您能否在您发布的行周围发布更多上下文?
-
第 13 行有语法错误,但这里显示的是第 10 行和第 11 行
-
@henrikhodne,没有第 13 行。11 是最后一行。
标签: ruby-on-rails ruby erb