class FacturesController < ApplicationController
+ # on saute la sécurité si demande de facture PDF
skip_before_action :authenticate_user!, only: [:show]
before_action :set_facture, only: [:show, :edit, :update, :destroy]
private
# Use callbacks to share common setup or constraints between actions.
def set_facture
- @facture = Facture.friendly.find(params[:id])
+ #@facture = Facture.friendly.find(params[:id])
+ @facture = Facture.find_by(slug: params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.