Show on edit screens
By default, has_and_belongs_to_many is only visible on the Show page. If you want to enable it on the Edit page, too, you need to add the show_on: :edit option.
WARNING
Adding associations on the New screen is not currently supported. The association needs some information from the parent record that hasn't been created yet (because the user is on the New screen).
You may use the redirect helpers to have the following flow:
- User is on the
Newview. They can't see the association panels yet. - User creates the record.
- They get redirected to the
Show/Editview, where they can see the association panels. - User attaches associations.