Class: RackAttackAdmin::KeysController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rack_attack_admin/keys_controller.rb

Direct Known Subclasses

BannedIpsController

Instance Method Summary collapse

Methods inherited from ApplicationController

#toggle_flags

Instance Method Details

#destroyObject



3
4
5
6
7
8
9
# File 'app/controllers/rack_attack_admin/keys_controller.rb', line 3

def destroy
  orig_key = params[:id]
  unprefixed_key = Rack::Attack.unprefix_key(orig_key)
  Rack::Attack.cache.delete unprefixed_key
  flash[:success] = "Deleted #{unprefixed_key}"
  redirect_to root_path
end