Idiomatic Rails way to create/destroy association models?

In Ruby on Rails I have the following model relationship: A has_many :c, through: :foobar, source: :foobarable, source_type: “C”. When I want to create (or remove) an association (foobar) between A and C, what is the idiomatic Rails way of doing this through the UI? For example from an A view, add (or remove) a C (or vice-versa).

Should I have an independent controller for the association model (foobar) with create and destroy actions that are called to add or remove an association?

More specifically…

Does it make more sense to add new actions to as_controller like:

  • add_c
  • remove_c

And cs_controller like:

  • add_a
  • remove_a

Or have a foobars_controller with:

  • create
  • destroy

That can be called from either side of the UI workflow.

The idiomatic way would be to have create and destroy actions on the association controller.

In terms of the views, that is a lot more wide open and depends on your app and the specifics of its UI. You can add buttons or links to the views for A and/or C, and/or something else entirely that hits the association create/destroy action.