Form for another controller in a view

Let’s say I have table ‘groups’ and table ‘members’.

When SHOWing a particular group I included the form for members (Add
new).

What approach should I use for making sure that members add to the group
being shown?

I could create a hidden tag (group_id), but I want to know how others do
it in Rails.