I need to display time selector in my active admin form. I have a field start_time which is of type time. Currently I have drop-downs.
I need a selector similar to date picker as shown
For adding Date Picker I used
f.input :start_date, :as => :datepicker
ActiveAdmin.register PromoCode do
form :html => { :enctype => "multipart/form-data" } do |f|
f.inputs "PromoCodes" do
f.input :promo_code
f.input :start_date, :as => :datepicker
f.input :start_time
end
f.buttons
end
end
Is there similar way to get time picker in active admin. Please help.
Though the datepicker
will show a calendar to chose a date form, i've no idea how a time picker would work! Should it show a clock :)?
However, there is another selector in formtastic (which is used by activeadmin). that is time_picker
. So you use that as follow:
f.input :start_time, :as => :time_picker
More is in the Doc