0
我有不同範圍的模型Rails的添加範圍Mongoid標準
class Contact
include Mongoid::Document
scope :active
scope :urgent
scope :no_one_in_charge
在我的一些控制的,我拉的活動作用域
my_controller.rb
def my_action
@contacts = Contact.active
現在看來,我想用更具體的範圍生成很多表格
my_action.html.erb
<h3>Unassigned</h3>
<%= @contacts.[how Do I add the :no_one_in_charge scope ?] %>
<h3>Urgent</h3>
<%= @contacts.[how Do I add the :urgent scope ?] %>
您可以鏈接範圍正確嗎? – 2015-04-05 15:07:25