Class: ContainersController

Inherits:
MVCLI::Controller
  • Object
show all
Defined in:
app/controllers/containers_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/containers_controller.rb', line 9

def create
  template = Containers::CreateForm
  argv = MVCLI::Argv.new command.argv
  form = template.new argv.options
  form.validate!

  options = {
    key: form.name
  }

  containers.create options
end

#destroyObject



26
27
28
29
30
31
# File 'app/controllers/containers_controller.rb', line 26

def destroy
  #Note, cannot destroy a container with files in it
  directory.tap do |d|
    d.destroy
  end
end

#indexObject



5
6
7
# File 'app/controllers/containers_controller.rb', line 5

def index
  containers.all
end

#showObject



22
23
24
# File 'app/controllers/containers_controller.rb', line 22

def show
  directory
end