Rails ActiveAdmin 为一个行标题添加多行



我想像照片上一样用一行标题显示多个对象,但我无法在"特蕾莎·门多萨"下显示其他用户。

活动管理员示例

这是我当前的代码:

row('Staff Users') do |v|
if v.staff_users.present?
v.staff_users.first.full_name
end
end

我尝试像下面的代码一样做,但它不起作用:

if vendor.staff_users.present?
vendor.staff_users.each do |u|
row('') do
u.full_name
end 
end 
end 

有人知道我该如何解决这个问题吗? 谢谢!

编辑:如果我删除行中的.firstv.staff_users.first_full_name则此错误将显示:

活动管理错误

您可以在表格中显示如下内容 -

table_for(vendor.staff_users) do
column :full_name do |resource|
resource.full_name
end
end

最新更新