blob: f06ce0943ec9ad4fa590d9ccfa6a7e7c15d209dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
class Admin::RunnerProjectsController < Admin::ApplicationController
layout 'project'
def index
@runner_projects = project.runner_projects.all
@runner_project = project.runner_projects.new
end
def create
@runner = Runner.find(params[:runner_project][:runner_id])
if @runner.assign_to(project, current_user)
redirect_to admin_runner_path(@runner)
else
redirect_to admin_runner_path(@runner), alert: 'Failed adding runner to project'
end
end
def destroy
rp = RunnerProject.find(params[:id])
runner = rp.runner
rp.destroy
redirect_to admin_runner_path(runner)
end
private
def project
@project ||= Project.find(params[:project_id])
end
end
|