RAILS How can I build a nested form to change a has_many through associated object boolean attribute using checkboxes?
RAILS How can I build a nested form to change a has_many through associated object boolean attribute using checkboxes? I have 3 Models: User , Profile and Photo . User Profile Photo Profile < ApplicationRecord belongs_to :user has_many :photos, through: :user Photo < ApplicationRecord belongs to :user User < ApplicationRecord has_one :profile has_many :photos I'd like to build a form for @profile that also displays checkboxes for all of its associated photos. @profile When a photo is checked, I'd like the that photo's # featured_status to be turned to be TRUE . (it has a default value of 1 in my database). featured_status TRUE Photo class has these methods class Photo < ApplicationRecord belongs_to :user has_attached_file :image, styles: { medium: "300x300>", thumb: "100x100>" }, default_url: "/images/:style/missing.png" validates_attachment_content_type :image, content_type: /Aimage/.*z/ validates :image, :title, ...