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