我在 activeadmin 仪表板中。我试图只显示 current_user 的客户,但我得到一个错误undefined local variable or method
current_user'`
这是我的仪表板代码:
section "Recent Customers" do
table_for Customer.owned_by(current_user).limit(5) do
column "Name" do |customer|
link_to customer.name, admin_customers_path(customer)
end
column :phone
column :email, :sortable => :email do |customer|
link_to customer.email, "mailto:#{customer.email}"
end
end
strong { link_to "View All Customers", admin_customers_path }
end