summaryrefslogtreecommitdiff
path: root/app/controllers/tartiflettes_controller.rb
diff options
context:
space:
mode:
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