dimanche 26 février 2017

What is the right way to implement multiple checkboxes?

My project is Angular 2 + Rails API and I need to use multiple checkboxes.

I created has_and_belongs_to_many association for User and Pet models. Then I created an array of checkboxes on frontend and displayed it, for example:

dog

cat

parrot

After user checks some options, I then send those to the server and these values persist in the join table.

My question - is this the right way of implementing multiple checkboxes?




Aucun commentaire:

Enregistrer un commentaire