Permalink
Browse files

Added API keys controller

  • Loading branch information...
1 parent 7d09fc7 commit 0ae0928321c3418172f42374b9468ea6bef0d0f6 @skalnik skalnik committed Jun 30, 2010
@@ -0,0 +1,20 @@
+class APIKeysController < ApplicationController
+ before_filter :login_from_cookie
+ before_filter :login_required
+
+ def create
+ current_user.enable_api!
+
+ respond_to.do |format|
+ format.html { redirect_to edit_user_path(current_user) }
+ end
+ end
+
+ def destroy
+ current_user.disable_api!
+
+ respond_to.do |format|
+ format.html { redirect_to edit_user_path(current_user) }
+ end
+ end
+end
@@ -0,0 +1,2 @@
+module APIKeysHelper
+end
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class APIKeysHelperTest < ActionView::TestCase
+end

0 comments on commit 0ae0928

Please sign in to comment.