I am working with Active Admin to create a form which has a radio collection.
form do |f|
f.inputs "Options" do
f.input :type, as: :radio, collection: Types.all.map{|type| [type.name, type.name]}
end
end
I want to add a hint to each option in the radio collection. (A hint similar to a string input or various others).
What is the best way to go about this?
I would do it this way:
the method
pluck
is same as doingType.all.map(&:name)
see http://apidock.com/rails/ActiveRecord/Calculations/pluck for more info.