我有一个名为优先级的代码表。该表有一个名为存档的布尔值。我有一个请求表,它的表格包含优先级选择列表。我正在使用范围声明来判断优先级是否已归档。这是模型中的代码:
scope :archived, where(:archive => true)
scope :active, where(:archive => false)
我正在尝试使用请求表单中的范围,如下所示:
<%= f.association :priority, :label_method => :prioritycode.active, :label => 'Priority' %>
但是,这是行不通的。
我应该在表格中使用什么?
谢谢!