upto 2.11

This commit is contained in:
Aaro Koivukangas
2023-08-08 10:32:52 +03:00
parent 852c9b35c3
commit 403a3c3674
3 changed files with 10 additions and 4 deletions
+7
View File
@@ -7,8 +7,15 @@ class RatingsController < ApplicationController
@rating = Rating.new
@beers = Beer.all
end
def create
Rating.create params.require(:rating).permit(:score, :beer_id)
redirect_to ratings_path
end
def destroy
rating = Rating.find params[:id]
rating.delete
redirect_to ratings_path
end
end