summaryrefslogtreecommitdiff
path: root/app/controllers/fertilizer_products_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/fertilizer_products_controller.rb
parent8f8cea2a0408918629dc8bab03495530861a71f3 (diff)
Simpler, Better, Faster... StrongerHEADmaster
Start small, address critical customer needs, /then/ scale.
Diffstat (limited to 'app/controllers/fertilizer_products_controller.rb')
-rw-r--r--app/controllers/fertilizer_products_controller.rb70
1 files changed, 0 insertions, 70 deletions
diff --git a/app/controllers/fertilizer_products_controller.rb b/app/controllers/fertilizer_products_controller.rb
deleted file mode 100644
index ff0d945..0000000
--- a/app/controllers/fertilizer_products_controller.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-class FertilizerProductsController < ApplicationController
- before_action :set_fertilizer_product, only: %i[ show edit update destroy ]
-
- # GET /fertilizer_products or /fertilizer_products.json
- def index
- @fertilizer_products = FertilizerProduct.all
- end
-
- # GET /fertilizer_products/1 or /fertilizer_products/1.json
- def show
- end
-
- # GET /fertilizer_products/new
- def new
- @fertilizer_product = FertilizerProduct.new
- end
-
- # GET /fertilizer_products/1/edit
- def edit
- end
-
- # POST /fertilizer_products or /fertilizer_products.json
- def create
- @fertilizer_product = FertilizerProduct.new(fertilizer_product_params)
-
- respond_to do |format|
- if @fertilizer_product.save
- format.html { redirect_to @fertilizer_product, notice: "Fertilizer product was successfully created." }
- format.json { render :show, status: :created, location: @fertilizer_product }
- else
- format.html { render :new, status: :unprocessable_entity }
- format.json { render json: @fertilizer_product.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PATCH/PUT /fertilizer_products/1 or /fertilizer_products/1.json
- def update
- respond_to do |format|
- if @fertilizer_product.update(fertilizer_product_params)
- format.html { redirect_to @fertilizer_product, notice: "Fertilizer product was successfully updated.", status: :see_other }
- format.json { render :show, status: :ok, location: @fertilizer_product }
- else
- format.html { render :edit, status: :unprocessable_entity }
- format.json { render json: @fertilizer_product.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /fertilizer_products/1 or /fertilizer_products/1.json
- def destroy
- @fertilizer_product.destroy!
-
- respond_to do |format|
- format.html { redirect_to fertilizer_products_path, notice: "Fertilizer product 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_product
- @fertilizer_product = FertilizerProduct.find(params.expect(:id))
- end
-
- # Only allow a list of trusted parameters through.
- def fertilizer_product_params
- params.expect(fertilizer_product: [ :name, :purity ])
- end
-end
Copyright 2019--2025 Marius PETER