is there any way to customize the buttons generated by activeadmin formbuilder

385 Views Asked by At
form do |f|
    f.inputs "Mission" do
      f.input :level
      f.input :points
      f.input :title
      f.input :description
    end

    f.has_many :requirements do |r|
      r.input :kind, as: :select, collection: %w(text video image)
      r.input :count
      r.input :description, as: :text
    end

    f.actions
  end

This is actually generating an "Add New Requirement" button at the bottom of the form. Now i would like to customize that button like want add custom id or want to change the name , how can i do that

1

There are 1 best solutions below

2
Joel Blum On

ActiveAdmin's form uses Formtasic under the hood, and the actions supports passing a block where you can render pretty much what you'd like. For example:

<%= f.actions do %>
  <%= f.action :submit, label: 'My text', id: 'some-id' %>
<% end %>