I have a model ‘Car’ that has_many ‘features’ . I keep all the features in a separate model ‘Features’.When a car is created, I want to let the user select (via check-boxes) what features should the new car have.
Right now I’m doing something like this, which is wrong, but I have no other idea :
= f.label 'other features'
- Feature.all.each do |feature|
= f.check_box :feature
How could I achieve this ?
1 Answer