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:
Brian Kim 2013-02-18 14:20:37 -05:00
parent 8743f800db
commit f9f6fc7a91
1 changed files with 2 additions and 1 deletions

View File

@ -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
```