<% @pad.bombs.where("group = 0").each_with_index do |bomb,index| %>
会报错
ActionView::Template::Error (SQLite3::SQLException: near "group": syntax error: SELECT "bombs".* FROM "bombs" WHERE "bombs"."pad_id" = ? AND (group = 0)):
但是写成
<% @pad.bombs.where(group: 0).each_with_index do |bomb,index| %>
就没问题……这是为什么