From 8ba568ae0ebe715b5da453681eb141886f1977a8 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 4 Sep 2025 20:55:03 +0200 Subject: Simpler, Better, Faster... Stronger Start small, address critical customer needs, /then/ scale. --- app/controllers/crops_controller.rb | 58 ------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 app/controllers/crops_controller.rb (limited to 'app/controllers/crops_controller.rb') diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb deleted file mode 100644 index 951d380..0000000 --- a/app/controllers/crops_controller.rb +++ /dev/null @@ -1,58 +0,0 @@ -class CropsController < ApplicationController - before_action :set_crop, only: %i[ show edit update destroy ] - - def index - @crops = Crop.all - end - - def show - end - - def new - @crop = Crop.new - end - - def edit - end - - def create - @crop = Crop.new(crop_params) - - if @crop.save - redirect_to @crop, notice: "Crop was successfully created." - else - render :new, status: :unprocessable_entity - end - end - - def update - respond_to do |format| - if @crop.update(crop_params) - format.html { redirect_to @crop, notice: "Crop was successfully updated.", status: :see_other } - format.json { render :show, status: :ok, location: @crop } - else - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @crop.errors, status: :unprocessable_entity } - end - end - end - - def destroy - @crop.destroy! - - respond_to do |format| - format.html { redirect_to crops_path, notice: "Crop was successfully destroyed.", status: :see_other } - format.json { head :no_content } - end - end - - private - - def set_crop - @crop = Crop.find(params.expect(:id)) - end - - def crop_params - params.expect(crop: [ :name, :crop_type, :nno3, :p, :k, :ca, :mg, :s, :na, :cl, :si, :fe, :zn, :b, :mn, :cu, :mo, :nnh4 ]) - end -end -- cgit v1.2.3