Skip to content

Commit

Permalink
Add remove_record to the form examples
Browse files Browse the repository at this point in the history
  • Loading branch information
littleforest committed Oct 24, 2020
1 parent 5177bd6 commit 4a31c2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/5-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ ActiveAdmin.register Post do
f.inputs do
f.has_many :comment,
new_record: 'Leave Comment',
remove_record: 'Remove Comment',
allow_destroy: -> (c) { c.author?(current_admin_user) } do |b|
b.input :body
end
Expand Down Expand Up @@ -139,6 +140,10 @@ The `:new_record` option controls the visibility of the new record button (shown
by default). If you pass a string, it will be used as the text for the new
record button.

The `:remove_record` option controls the text of the remove button (shown after
the new record button is pressed). If you pass a string, it will be used as the
text for the remove button.

The `:sortable` option adds a hidden field and will enable drag & drop sorting
of the children. It expects the name of the column that will store the index of
each child.
Expand Down

0 comments on commit 4a31c2f

Please sign in to comment.