fixes #2166
This commit is contained in:
17
app/controllers/api_keys_controller.rb
Normal file
17
app/controllers/api_keys_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class ApiKeysController < ApplicationController
|
||||
before_filter :gold_only
|
||||
|
||||
def new
|
||||
@api_key = ApiKey.new(:user_id => CurrentUser.user.id)
|
||||
end
|
||||
|
||||
def create
|
||||
@api_key = ApiKey.generate!(CurrentUser.user)
|
||||
|
||||
if @api_key.errors.empty?
|
||||
redirect_to user_path(CurrentUser.user), :notice => "API key generated"
|
||||
else
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user