gitlabhq/app/controllers/keys_controller.rb

36 lines
594 B
Ruby
Raw Normal View History

2011-10-08 23:36:38 +02:00
class KeysController < ApplicationController
2011-11-02 16:21:17 +01:00
layout "profile"
respond_to :js, :html
2011-10-08 23:36:38 +02:00
def index
@keys = current_user.keys.all
end
def show
@key = current_user.keys.find(params[:id])
end
2011-10-08 23:36:38 +02:00
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 }
2011-10-08 23:36:38 +02:00
end
end
end