authorizations_controller.rb 372 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. class AuthorizationsController < ApplicationController
  3. before_action :authenticate_user!
  4. before_action :set_authorization
  5. def destroy
  6. @authorization.destroy
  7. redirect_to account_path, notice: 'Disconnected!'
  8. end
  9. private
  10. def set_authorization
  11. @authorization = current_user.authorizations.find(params[:id])
  12. end
  13. end