Class: Admin::RunnerProjectsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/runner_projects_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


9
10
11
12
13
14
15
16
17
# File 'app/controllers/admin/runner_projects_controller.rb', line 9

def create
  @runner = Ci::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

#destroyObject


19
20
21
22
23
24
25
# File 'app/controllers/admin/runner_projects_controller.rb', line 19

def destroy
  rp = Ci::RunnerProject.find(params[:id])
  runner = rp.runner
  rp.destroy

  redirect_to admin_runner_path(runner)
end

#indexObject


4
5
6
7
# File 'app/controllers/admin/runner_projects_controller.rb', line 4

def index
  @runner_projects = project.runner_projects.all
  @runner_project = project.runner_projects.new
end