I have next models:
class Student < ApplicationRecord
has_many :special_offers_participants
end
class SpecialOffersParticipant < ApplicationRecord
belongs_to :special_offer
belongs_to :student
end
class SpecialOffer < ApplicationRecord
has_many :special_offers_participants
end
I need to create registration form for student that depending on session attributes will either have special offer acceptance or decline radio buttons, either not (session can have special_offer_id). Itβs obvious for me to acomplish this using nested form attributes, but the form should have a question: Do you accept special offer
and radio buttons: Yes/No
. Besides that the answer to this question should be required.
Can you provide me any direction to complete the solution?