我不断收到我的Rails 4 Ruby 2应用程序中的语法错误,但我不明白为什么。我认为这是发生在10行语法错误,意外的'|'
<% ('A'..'Z').each do |i| %>
<h2><%= i.capitalize %></h2>
<hr class="half-rule">
<% lesson_num = [] %>
<% start_id = 0 %>
<% last_id = current_user.last_lesson %>
<% until start_id >= last_id do |x| %>
<% lesson_num << [x]%>
<% x += 1 %>
<% end %>
<% lesson_num.each do |id| %>
<% lesson = Lesson.find(id) %>
<% tags = @lesson.tags.split(',') %>
<% tags.each_with_index do |tag, index| %>
<% letter = tag.initial %>
<% if letter == i %>
<a href="/lesson/<%= id %>/step/1"><%= tag %></a>
<% else %>
<!-- else is only necessary if you actually need to put something here.-->
<% end %>
<% end %>
<% end %>
<% end %>
Ruby中'until'-loop的语法是什么?那个循环里面的内容会改变什么会改变循环条件的真实性? – 2014-08-29 02:42:59