|
|
|
@ -20,6 +20,19 @@ class LivresController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def edit |
|
|
|
@livre = Livre.find(params[:id]) |
|
|
|
end |
|
|
|
|
|
|
|
def update |
|
|
|
@livre = Livre.find(params[:id]) |
|
|
|
if @livre.update(livre_params) |
|
|
|
redirect_to livres_path, notice: "Livre modifié avec succès." |
|
|
|
else |
|
|
|
render :edit, status: :unprocessable_entity |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def destroy |
|
|
|
@livre = Livre.find(params[:id]) |
|
|
|
@livre.destroy |
|
|
|
|