2011-12-29 20:44:16 +01:00
|
|
|
class DeployKeysController < ApplicationController
|
|
|
|
respond_to :js
|
|
|
|
layout "project"
|
|
|
|
before_filter :project
|
|
|
|
# before_filter :authorize_admin_project!
|
|
|
|
# before_filter :require_non_empty_project
|
|
|
|
|
|
|
|
def project
|
|
|
|
@project ||= Project.find_by_code(params[:project_id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def index
|
|
|
|
@keys = @project.deploy_keys.all
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
@key = @project.deploy_keys.find(params[:id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def new
|
|
|
|
@key = @project.deploy_keys.new
|
|
|
|
|
|
|
|
respond_with(@key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
2011-12-29 22:31:27 +01:00
|
|
|
@key = @project.deploy_keys.new(params[:deploy_key])
|
2011-12-29 20:44:16 +01:00
|
|
|
@key.save
|
|
|
|
|
|
|
|
respond_with(@key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
@key = @project.deploy_keys.find(params[:id])
|
|
|
|
@key.destroy
|
|
|
|
|
|
|
|
respond_to do |format|
|
2011-12-29 22:31:27 +01:00
|
|
|
format.html { redirect_to project_deploy_keys_url }
|
2011-12-29 20:44:16 +01:00
|
|
|
format.js { render :nothing => true }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|