您如何创建 ActiveAdmin 评论 table?
How do you create the ActiveAdmin comments table?
我看到 ActiveAdmin 有一个叫做评论的功能:
https://activeadmin.info/1-general-configuration.html#comments
我想试试这个功能。所以我启用了它,即
config.comments = true
config.comments_registration_name = 'ActiveAdminComment'
当我重新启动 rails 服务器时,我收到错误消息:
error='ActionView::Template::Error: PG::UndefinedTable: ERROR: relation "active_admin_comments" does not exist
显然我需要创建一个名为 active_admin_comments
的 table。
但是我该如何创建这个 table? ActiveAdmin 能否生成迁移来创建此 table?
谢谢
是的。 install generator should create the migration for you. If you don't have it try re-running the installation, perhaps on a new project. If you look in the source you will find it in lib/generators/active_admin/install
我看到 ActiveAdmin 有一个叫做评论的功能: https://activeadmin.info/1-general-configuration.html#comments
我想试试这个功能。所以我启用了它,即
config.comments = true
config.comments_registration_name = 'ActiveAdminComment'
当我重新启动 rails 服务器时,我收到错误消息:
error='ActionView::Template::Error: PG::UndefinedTable: ERROR: relation "active_admin_comments" does not exist
显然我需要创建一个名为 active_admin_comments
的 table。
但是我该如何创建这个 table? ActiveAdmin 能否生成迁移来创建此 table?
谢谢
是的。 install generator should create the migration for you. If you don't have it try re-running the installation, perhaps on a new project. If you look in the source you will find it in lib/generators/active_admin/install