If you want to show several fields in a panel bar, you can use the following view:
show do |phy| panel "Details" do attributes_table do ... # Other fields come here row :appointment_dates do apps="" phy.appointments.all.each do |app| apps += app.patient.name + ":" + app.appoinment_date + ", " end apps.chomp(", ") end end end end
To place it in the selected form, first set the destination_ids parameter to the allowed list:
permit_params: appointment_ids:[]
Add has a lot to do with the form
form do |f| f.has_many :appointments do |app| app.inputs "Appointments" do app.input :patients, :as => :select, :label => "Assigned Patients" app.input :appointment_date end end end
Should work if there is no coding error.
Tahsin Turkoz Aug 26 '16 at 22:17 2016-08-26 22:17
source share