简体   繁体   English

Active_admin导轨中的错误未定义方法`group_values'

[英]error undefined method `group_values' in active_admin rails

I try to implements active_admin in my app, and i'm follow this tutorial : 我尝试在我的应用程序中实现active_admin,并且我遵循此教程:

http://activeadmin.info/documentation.html

But when i'm execute this command in my console : 但是当我在控制台中执行以下命令时:

rails generate active_admin:resource product

The file successfully generate : 该文件成功生成:

app/admin/product.rb

But when i'm access index product page in active_admin i get error like this : 但是,当我在active_admin中访问索引产品页面时,出现如下错误:

ActionView::Template::Error (undefined method `group_values' for #<Array:0xcfe093c>)

how to fix this? 如何解决这个问题? thanks before 之前感谢

In your admin/product.rb you can put this code: 在您的admin/product.rb您可以输入以下代码:

ActiveAdmin.register Product, :as => "All Product" do

end

Hopefully, this will help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM