blob: 1a25d834e129220e21bb57e2a1c4a2a844fd20fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
class KeysController < ApplicationController
layout "profile"
respond_to :js, :html
def index
@keys = current_user.keys.all
end
def show
@key = current_user.keys.find(params[:id])
end
def new
@key = current_user.keys.new
respond_with(@key)
end
def create
@key = current_user.keys.new(params[:key])
@key.save
respond_with(@key)
end
def destroy
@key = current_user.keys.find(params[:id])
@key.destroy
respond_to do |format|
format.html { redirect_to keys_url }
format.js { render nothing: true }
end
end
end
|