I am trying to add ActiveAdmin::Comment to my Member editing. I was able to do this by adding ARB and partial
#_comments.html.arb active_admin_comments_for(resource)
This displays correctly, but when I print the text, click the add comment button, the comment is not really added, it just goes back to the display screen.
What I'm trying to do is get comments there, but not have the Add Comment button. I would like to add a comment by clicking the Update Member button. Thus, any changes made to the element will be saved along with the comment.
Is there a way to have comments added using the Update Member button?
EDIT:
I also tried to add a relation in my model
#model has_many :comments, as: :resource, dependent: :destroy, class_name: 'ActiveAdmin::Comment' accepts_nested_attributes_for :comments, reject_if: :reject_comment # members.rb - form f.inputs "Add A Comment" do f.semantic_fields_for :comments, ActiveAdmin::Comment.new do |c| c.inputs :class => "" do c.input :resource_id, :input_html => { :value => "1" }, as: :hidden c.input :resource_type, :input_html => { :value => "Member" }, as: :hidden c.input :namespace, :input_html => { :value => :admin }, as: :hidden c.input :body, :label => "Comment" end end end
However, even with enabled options, it is still not saved as a comment.
source share