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