Rails - how to store “has_many” checkboxes association in database?
问题 I have the table User and the table Categories . The relation between these two tables: user has_many :categories category belongs_to :user I would like to display on the user's (standard) edit page the list of categories with checkboxes. When this user would check some of the checkboxes, I would like to save them and then display as checked when he open the page the next time. But how to render the checkboxes in the view? And how to store information about what checkboxes the user checked in