Fix bug in code example from layouts and rendering guide
The code in 2.3.2 assumed that render has an alert option like redirect_to to create a flash alert message, but it doesn't.
This commit is contained in:
parent
8743f800db
commit
f9f6fc7a91
|
@ -568,7 +568,8 @@ def show
|
|||
@book = Book.find_by_id(params[:id])
|
||||
if @book.nil?
|
||||
@books = Book.all
|
||||
render "index", alert: "Your book was not found!"
|
||||
flash[:alert] = "Your book was not found"
|
||||
render "index"
|
||||
end
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue