简体   繁体   中英

how to customize active admin views in rails?

I have active admin in my rails application.

Currently, the date of birth field, is having the dropdowns of year and month and date. I want to change this date field, to a jquery date picker in active admin.

How can I do this customization in active admin? can someone help me with this?

在此处输入图片说明

As written in the documentation here: https://activeadmin.info/5-forms.html#datepicker you can use JQuery datepicker in you custom views. In your example I would use it like that:

form title: 'User details' do |f|
f.input :dob, as: :datepicker,
      datepicker_options: { show_week: true, first_day: 1 ,
                           dateFormat: 'DD, dd-MM-yy',setDate: '0'}
end

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