I have Groups and PhoneNumbers models connected with a has_many through relationship called group_phone_numbers.
Basically, on a group edit view, I want a list of phone_numbers with add or remove links next to them. When someone clicks add, it creates an association between the models and when someone clicks remove, it removes it. Is the proper way to do this by using a form? Or should I just do a link_to a custom controller action?
http://railscasts.com/episodes/196-nested-model-form-part-1?view=asciicast is what you need. fields_for
specifically...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.