silences_controller.rb 424 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. module Admin
  3. class SilencesController < BaseController
  4. before_action :set_account
  5. def create
  6. @account.update(silenced: true)
  7. redirect_to admin_accounts_path
  8. end
  9. def destroy
  10. @account.update(silenced: false)
  11. redirect_to admin_accounts_path
  12. end
  13. private
  14. def set_account
  15. @account = Account.find(params[:account_id])
  16. end
  17. end
  18. end