mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
upto 2.11
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user