summaryrefslogtreecommitdiff
path: root/app/controllers/fertilizers_controller.rb
diff options
context:
space:
mode:
authorMarius Peter <dev@marius-peter.com>2025-09-04 20:55:03 +0200
committerMarius Peter <dev@marius-peter.com>2025-09-04 20:55:03 +0200
commit8ba568ae0ebe715b5da453681eb141886f1977a8 (patch)
tree3bf3a3d5b41286d0a6da8895857314393bae1db2 /app/controllers/fertilizers_controller.rb
parent8f8cea2a0408918629dc8bab03495530861a71f3 (diff)
Simpler, Better, Faster... Stronger
Start small, address critical customer needs, /then/ scale.
Diffstat (limited to 'app/controllers/fertilizers_controller.rb')
-rw-r--r--app/controllers/fertilizers_controller.rb70
1 files changed, 0 insertions, 70 deletions
diff --git a/app/controllers/fertilizers_controller.rb b/app/controllers/fertilizers_controller.rb
deleted file mode 100644
index 040c462..0000000
--- a/app/controllers/fertilizers_controller.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-class FertilizersController < ApplicationController
- before_action :set_fertilizer, only: %i[ show edit update destroy ]
-
- # GET /fertilizers or /fertilizers.json
- def index
- @fertilizers = Fertilizer.all
- end
-
- # GET /fertilizers/1 or /fertilizers/1.json
- def show
- end
-
- # GET /fertilizers/new
- def new
- @fertilizer = Fertilizer.new
- end
-
- # GET /fertilizers/1/edit
- def edit
- end
-
- # POST /fertilizers or /fertilizers.json
- def create
- @fertilizer = Fertilizer.new(fertilizer_params)
-
- respond_to do |format|
- if @fertilizer.save
- format.html { redirect_to @fertilizer, notice: "Fertilizer was successfully created." }
- format.json { render :show, status: :created, location: @fertilizer }
- else
- format.html { render :new, status: :unprocessable_entity }
- format.json { render json: @fertilizer.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PATCH/PUT /fertilizers/1 or /fertilizers/1.json
- def update
- respond_to do |format|
- if @fertilizer.update(fertilizer_params)
- format.html { redirect_to @fertilizer, notice: "Fertilizer was successfully updated.", status: :see_other }
- format.json { render :show, status: :ok, location: @fertilizer }
- else
- format.html { render :edit, status: :unprocessable_entity }
- format.json { render json: @fertilizer.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /fertilizers/1 or /fertilizers/1.json
- def destroy
- @fertilizer.destroy!
-
- respond_to do |format|
- format.html { redirect_to fertilizers_path, notice: "Fertilizer was successfully destroyed.", status: :see_other }
- format.json { head :no_content }
- end
- end
-
- private
- # Use callbacks to share common setup or constraints between actions.
- def set_fertilizer
- @fertilizer = Fertilizer.find(params.expect(:id))
- end
-
- # Only allow a list of trusted parameters through.
- def fertilizer_params
- params.expect(fertilizer: [ :name, :formula, :nno3, :nnh4, :p, :k, :ca, :mg, :s, :na, :cl, :si, :fe, :zn, :b, :mn, :cu, :mo ])
- end
-end
Copyright 2019--2025 Marius PETER