Files
brewery/app/controllers/ratings_controller.rb
T
2023-08-08 09:31:03 +03:00

15 lines
275 B
Ruby

class RatingsController < ApplicationController
def index
@ratings = Rating.all
end
def new
@rating = Rating.new
@beers = Beer.all
end
def create
Rating.create params.require(:rating).permit(:score, :beer_id)
redirect_to ratings_path
end
end