2016-01-05 42 views
0

我遇到了問題與表格,我可以選擇真或假。
在模型票,我得到:
type:booleanRails輸入表格布爾

當我在做形式check_box我得到這個錯誤信息:

Invalid single-table inheritance type: 1 is not a subclass of Ticket

我的表單代碼:
<%= form_for [@movie, @seance, @ticket] do |f| %>
<div>
<%= f.label :type %>
<%= f.check_box :type %>
<%end%>

回答

3

type是ruby-on-rails中用於STI的保留字。

將列名更改爲:ticket_type