Class: UnzipsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#choose_layout

Instance Method Details

#createObject

POST /unzips POST /unzips.json



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

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



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

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



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

def edit
end

#indexObject

GET /unzips GET /unzips.json



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

def index
  @unzips = Unzip.all
end

#newObject

GET /unzips/new



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

def new
  @unzip = Unzip.new
end

#showObject

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



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

def show
end

#updateObject

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



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

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