I am using ActiveAdmin to build an article show page where new comments can be added using a nested form but facing a problem. Article has_many :comments
and also accepts_nested_attributes_for :comments
. It all works fine in Rails console but I can't get the form submit button to show up. Here is my code for customizing activeadmin's show page for Article:
show do |article|
attributes_table do
row :id
row :title
end
div do
semantic_form_for [:admin, article], builder: ActiveAdmin::FormBuilder do |f|
f.has_many :comments, allow_destroy: false, new_record: true, heading: false do |g|
g.input :body
end
f.actions
end
end
end
The nested form is displayed and works correctly but the submit button is not displayed (meaning that f.actions
has no effect).
Aucun commentaire:
Enregistrer un commentaire