ActiveAdmin Comment model not working properly
Look like a bug (ActiveAdmin has it's own built-in Comment
model/class already): https://github.com/gregbell/active_admin/issues/64
A possible workaround could be to give your Comment
model a different name within in app/admin/comments.rb
:
ActiveAdmin.register Comment, :as => "PostComment" do
try this
run in terminal
rails g active_admin:resource ActiveAdmin::Comment
add a following lines inapp/admin/active_admin_comment.rb
ActiveAdmin.register ActiveAdmin::Comment, :as => "Comment" doend
after that edit config/initializers/active_admin
[...] config.comments_registration_name = "OldComment" config.show_comments_in_menu = false[...]
And now you have opportunity to customize a comments in app/admin/active_admin_comment.rbbut i still didn't find solution to add :update and :destroy actions
I had the same problem with version 1.0.0.pre, but thankfully, you can suppress ActiveAdmin comments altogether with a config in active_admin.rb then you don't have to alias your own Comment model anymore as mentioned above.
config/initializers/active_admin.rb
... # == Admin Comments # # This allows your users to comment on any resource registered with Active Admin. # # You can completely disable comments: config.allow_comments = false #
It's also listed in the docs: https://github.com/gregbell/active_admin/blob/master/docs/1-general-configuration.md#comments