Class: UnzipsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/unzips_controller.rb

Overview

typed: false

Instance Method Summary collapse

Methods inherited from ApplicationController

#gdpr_compliance

Instance Method Details

#createObject

POST /unzips POST /unzips.json



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/unzips_controller.rb', line 27

def create
  @unzip = Unzip.new(unzip_params)
  @unzip.run_on_current_host__unsafe

  # byebug
  respond_to do |format|
    if @unzip.save
      format.html { redirect_to @unzip, notice: 'Unzip was successfully created.' }
      format.json { render :show, status: :created, location: @unzip }
    else
      format.html { render :new }
      format.json { render json: @unzip.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /unzips/1 DELETE /unzips/1.json



59
60
61
62
63
64
65
# File 'app/controllers/unzips_controller.rb', line 59

def destroy
  @unzip.destroy
  respond_to do |format|
    format.html { redirect_to unzips_url, notice: 'Unzip was successfully destroyed.' }
    format.json { head :no_content }
  end
end

#editObject

GET /unzips/1/edit



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

def edit
end

#indexObject

GET /unzips GET /unzips.json



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

def index
  @unzips = Unzip.all
end

#newObject

GET /unzips/new



17
18
19
# File 'app/controllers/unzips_controller.rb', line 17

def new
  @unzip = Unzip.new
end

#showObject

GET /unzips/1 GET /unzips/1.json



13
14
# File 'app/controllers/unzips_controller.rb', line 13

def show
end

#updateObject

PATCH/PUT /unzips/1 PATCH/PUT /unzips/1.json



45
46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/unzips_controller.rb', line 45

def update
  respond_to do |format|
    if @unzip.update(unzip_params)
      format.html { redirect_to @unzip, notice: 'Unzip was successfully updated.' }
      format.json { render :show, status: :ok, location: @unzip }
    else
      format.html { render :edit }
      format.json { render json: @unzip.errors, status: :unprocessable_entity }
    end
  end
end