我在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
答案 0 :(得分:0)
尝试current_admin_user