gitlab-org--gitlab-foss/app/controllers/profiles/keys_controller.rb

36 lines
638 B
Ruby
Raw Normal View History

class Profiles::KeysController < ApplicationController
2011-11-02 15:21:17 +00:00
layout "profile"
2011-10-08 21:36:38 +00:00
def index
2013-06-24 16:25:10 +00:00
@keys = current_user.keys.order('id DESC').all
2011-10-08 21:36:38 +00:00
end
def show
@key = current_user.keys.find(params[:id])
end
2011-10-08 21:36:38 +00:00
def new
@key = current_user.keys.new
end
def create
@key = current_user.keys.new(params[:key])
if @key.save
redirect_to profile_key_path(@key)
else
render 'new'
end
2011-10-08 21:36:38 +00:00
end
def destroy
@key = current_user.keys.find(params[:id])
@key.destroy
respond_to do |format|
format.html { redirect_to profile_keys_url }
format.js { render nothing: true }
2011-10-08 21:36:38 +00:00
end
end
end