This commit is contained in:
Aaro Koivukangas
2023-08-08 10:10:45 +03:00
parent 83f58f47b2
commit a099e05279
4 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -13,6 +13,7 @@ class BeersController < ApplicationController
# GET /beers/new
def new
@beer = Beer.new
@breweries = Brewery.all
end
# GET /beers/1/edit
@@ -25,7 +26,7 @@ class BeersController < ApplicationController
respond_to do |format|
if @beer.save
format.html { redirect_to beer_url(@beer), notice: "Beer was successfully created." }
format.html { redirect_to beers_path, notice: "Beer was successfully created." }
format.json { render :show, status: :created, location: @beer }
else
format.html { render :new, status: :unprocessable_entity }