I have two models with following relations,
Class User
has_and_belongs_to_many :notification_channels
Class NotificationChannel
has_and_belongs_to_many :users
I am able to add notification channel for a user object in this way
@user.notification_channels << @notification
But removing channel from user's channels will remove the channel document from channels collection with following query
@user.notification_channels.find_by(id: params[:channel_id]).destroy
how can I remove a channel from user's channel ?