Class: CookieChangesController

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

Overview

typed: false

Instance Method Summary collapse

Methods inherited from ApplicationController

#gdpr_compliance

Instance Method Details

#createObject

POST /cookie_changes POST /cookie_changes.json



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/cookie_changes_controller.rb', line 29

def create
  @cookie_change = CookieChange.new(cookie_change_params)

  respond_to do |format|
    if @cookie_change.save
      cookies[@cookie_change.identifier] = @cookie_change.value

      format.html { redirect_to @cookie_change, notice: 'Cookie change was successfully created.' }
      format.json { render :show, status: :created, location: @cookie_change }
    else
      format.html { render :new }
      format.json { render json: @cookie_change.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /cookie_changes/1 DELETE /cookie_changes/1.json



61
62
63
64
65
66
67
# File 'app/controllers/cookie_changes_controller.rb', line 61

def destroy
  @cookie_change.destroy
  respond_to do |format|
    format.html { redirect_to cookie_changes_url, notice: 'Cookie change was successfully destroyed.' }
    format.json { head :no_content }
  end
end

#editObject

GET /cookie_changes/1/edit



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

def edit
end

#indexObject

GET /cookie_changes GET /cookie_changes.json



9
10
11
# File 'app/controllers/cookie_changes_controller.rb', line 9

def index
  @cookie_changes = CookieChange.all
end

#newObject

GET /cookie_changes/new



19
20
21
# File 'app/controllers/cookie_changes_controller.rb', line 19

def new
  @cookie_change = CookieChange.new
end

#showObject

GET /cookie_changes/1 GET /cookie_changes/1.json



15
16
# File 'app/controllers/cookie_changes_controller.rb', line 15

def show
end

#updateObject

PATCH/PUT /cookie_changes/1 PATCH/PUT /cookie_changes/1.json



47
48
49
50
51
52
53
54
55
56
57
# File 'app/controllers/cookie_changes_controller.rb', line 47

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