Class: RegistriesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch, Foreman::Controller::Parameters::DockerRegistry
Defined in:
app/controllers/registries_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
# File 'app/controllers/registries_controller.rb', line 15

def create
  @registry = DockerRegistry.new(docker_registry_params)
  if @registry.save
    process_success
  else
    process_error
  end
end

#destroyObject



35
36
37
38
39
40
41
# File 'app/controllers/registries_controller.rb', line 35

def destroy
  if @registry.destroy
    process_success
  else
    process_error
  end
end

#editObject



24
25
# File 'app/controllers/registries_controller.rb', line 24

def edit
end

#find_registryObject



43
44
45
46
47
# File 'app/controllers/registries_controller.rb', line 43

def find_registry
  @registry = DockerRegistry.find(params[:id])
rescue ActiveRecord::RecordNotFound
  not_found
end

#indexObject



6
7
8
9
# File 'app/controllers/registries_controller.rb', line 6

def index
  @registries = DockerRegistry.search_for(params[:search], :order => params[:order])
                .paginate :page => params[:page]
end

#newObject



11
12
13
# File 'app/controllers/registries_controller.rb', line 11

def new
  @registry = DockerRegistry.new
end

#updateObject



27
28
29
30
31
32
33
# File 'app/controllers/registries_controller.rb', line 27

def update
  if @registry.update_attributes(docker_registry_params)
    process_success
  else
    process_error
  end
end