简体   繁体   中英

Active Admin add + button

I have a model Post which have two attributes title - data-type string and description - data-type array

ActiveAdmin.register Post do
   permit_params :title, :description

   form do |f|
    f.inputs do
      f.input :title
      f.input :description
    end
    f.actions
  end

end
  1. Value of title is saving properly but value of description is not saving through the form. How to save array field?

  2. Can I put Add more button for description in active admin?

尝试更改名称以接受数组

f.input :description, input_html: { name: 'description[]' } 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM