Class: Admin::KeysController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/keys_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject


13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/admin/keys_controller.rb', line 13

def destroy
  key = user.keys.find(params[:id])

  respond_to do |format|
    if key.destroy
      format.html { redirect_to [:admin, user], notice: 'User key was successfully removed.' }
    else
      format.html { redirect_to [:admin, user], alert: 'Failed to remove user key.' }
    end
  end
end

#showObject


4
5
6
7
8
9
10
11
# File 'app/controllers/admin/keys_controller.rb', line 4

def show
  @key = user.keys.find(params[:id])

  respond_to do |format|
    format.html
    format.js { render nothing: true }
  end
end