summaryrefslogtreecommitdiff
path: root/app/controllers/tartiflettes_controller.rb
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
committerMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
commitbe2a93525069de2dfa3c23b0c23e7a9f7ad4c03d (patch)
treeb5493e9d35d024ce7be072ec2168b4a98ba0e63f /app/controllers/tartiflettes_controller.rb
First commit.
Diffstat (limited to 'app/controllers/tartiflettes_controller.rb')
-rw-r--r--app/controllers/tartiflettes_controller.rb26
1 files changed, 26 insertions, 0 deletions
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
Copyright 2019--2025 Marius PETER