I have this method in my groups controller.
def remove
@usergroup = Usergroup.where(group_id: params[:group_id]).destroy
redirect_to groups_path
end
And
<%= link_to 'Remove', { controller: "groups", action: "remove" },
group_id: @group.id, data: { confirm: 'Are you sure?' } %>
When I click remove and confirm the removal, I get this error.
I am a bit confused because the id of the group is 6 and it should be. For the group I am trying to remove somebody from. Why would it be giving me a no arguments error for this?
This is a route I have set. I believe this is the issue.
get 'groups/remove/:id', to: 'groups#remove'
