notebook/app/controllers/omniauth_accounts_controller.rb

13 lines
336 B
Ruby

class OmniauthAccountsController < ApplicationController
before_action :authenticate_user!
def destroy
if current_user.omniauth_users.find(params[:id]).destroy
flash[:notice] = 'The account was successfully disconnected.'
else
flash[:alert] = 'Something went wrong.'
end
redirect_to root_path
end
end