Class: CookieChangesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /cookie_changes POST /cookie_changes.json



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

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



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

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



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

def edit
end

#indexObject

GET /cookie_changes GET /cookie_changes.json



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

def index
  @cookie_changes = CookieChange.all
end

#newObject

GET /cookie_changes/new



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

def new
  @cookie_change = CookieChange.new
end

#showObject

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



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

def show
end

#updateObject

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



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

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