summaryrefslogtreecommitdiff
path: root/app/controllers/profiles/keys_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-24 18:24:14 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-24 18:24:14 +0300
commit3e09e6f7b8032859a82266282dfd35715b3b3727 (patch)
tree7f882004565743b11cb4c734cbdfb9417fa1a9ab /app/controllers/profiles/keys_controller.rb
parente55e23bbda6f6a95982109bc46e48a5550e4c181 (diff)
downloadgitlab-ce-3e09e6f7b8032859a82266282dfd35715b3b3727.tar.gz
Move Profile related controllers under Profiles:: module
Diffstat (limited to 'app/controllers/profiles/keys_controller.rb')
-rw-r--r--app/controllers/profiles/keys_controller.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb
new file mode 100644
index 00000000000..24a01040f52
--- /dev/null
+++ b/app/controllers/profiles/keys_controller.rb
@@ -0,0 +1,35 @@
+class Profiles::KeysController < ApplicationController
+ layout "profile"
+
+ 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
+ end
+
+ def create
+ @key = current_user.keys.new(params[:key])
+
+ if @key.save
+ redirect_to profile_key_path(@key)
+ else
+ render 'new'
+ end
+ 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 }
+ end
+ end
+end