I have nested resources in active admin edit page, but I would like only to allow admin to edit content of existing resources, not to add new nested resources. My code looks like that:
form do |f|
f.inputs do
f.input :author
f.input :content
f.has_many :comments do |comment_form|
comment_form.input :content
comment_form.input :_destroy, as: :boolean, required: false, label: 'Remove'
end
end
f.actions
end
But it add's "Add new comment" button under inputs. How can I disable it, and leave only f.actions buttons for main form?
Starting from v0.6.1
you can pass new_record: false
to hide the "Add new" button
f.has_many :comments, new_record: false do |comment_form|
...
end
The commit 4b58b8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With