Class: EziiCitiesController

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

Overview

typed: false

Instance Method Summary collapse

Methods inherited from ApplicationController

#gdpr_compliance

Instance Method Details

#createObject

POST /ezii_cities POST /ezii_cities.json



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

def create
  @ezii_city = EziiCity.new(ezii_city_params)

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

#destroyObject

DELETE /ezii_cities/1 DELETE /ezii_cities/1.json



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

def destroy
  @ezii_city.destroy
  respond_to do |format|
    format.html { redirect_to ezii_cities_url, notice: 'Ezii city was successfully destroyed.' }
    format.json { head :no_content }
  end
end

#editObject

GET /ezii_cities/1/edit



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

def edit
end

#indexObject

GET /ezii_cities GET /ezii_cities.json



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

def index
  @ezii_cities = EziiCity.all
end

#newObject

GET /ezii_cities/new



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

def new
  @ezii_city = EziiCity.new
end

#showObject

GET /ezii_cities/1 GET /ezii_cities/1.json



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

def show
end

#updateObject

PATCH/PUT /ezii_cities/1 PATCH/PUT /ezii_cities/1.json



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

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