From be2a93525069de2dfa3c23b0c23e7a9f7ad4c03d Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 29 Dec 2024 15:14:43 +0100 Subject: First commit. --- app/controllers/tartiflettes_controller.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/controllers/tartiflettes_controller.rb (limited to 'app/controllers/tartiflettes_controller.rb') diff --git a/app/controllers/tartiflettes_controller.rb b/app/controllers/tartiflettes_controller.rb new file mode 100644 index 0000000..cbea402 --- /dev/null +++ b/app/controllers/tartiflettes_controller.rb @@ -0,0 +1,26 @@ +class TartiflettesController < ApplicationController + before_action :set_tartiflette, only: [ :show ] + + def index + @tartiflettes = Tartiflette.all + end + + def show + end + + def new + @tartiflette = Tartiflette.new + end + + private + + def tartiflette_params + params.require(:tartiflette) + end + + def set_tartiflette + @tartiflette = Tartiflette.find(params[:id]) + rescue ActiveRecord::RecordNotFound + redirect_to root_path, alert: "Tartiflette introuvable." + end +end -- cgit v1.2.3