ich eine ziemlich grundlegende has_many :through
Setup habe:ActiveAdmin Form: has_many: durch als Kontrollkästchen mit zusätzlichen Daten
class Housing < ApplicationRecord
has_many :facilities_housings
has_many :facilities, through: :facilities_housings
...
end
class Facility < ApplicationRecord
has_many :facilities_housings
has_many :housings, through: :facilities_housings
...
end
class FacilitiesHousing < ApplicationRecord
belongs_to :facility, inverse_of: :facilities_housings
belongs_to :housing, inverse_of: :facilities_housings
...
end
Ich möchte ein Formular erstellen, die sich wie wie folgt aussieht:
Alle Einrichtungen sollten aufgelistet und je nach dem ersten Kontrollkästchen hinzugefügt/entfernt werden.
Ich weiß, das ist ziemlich trivial mit der has_many
von Helfer in ActiveAdmin enthalten, aber die UX ist nicht gut für diesen Anwendungsfall.