From f9f6fc7a91fecc7a52c812d2900b9ae5d4636743 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Mon, 18 Feb 2013 14:20:37 -0500 Subject: [PATCH] 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. --- guides/source/layouts_and_rendering.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md index 339008ab9e..bfd1a7c61b 100644 --- a/guides/source/layouts_and_rendering.md +++ b/guides/source/layouts_and_rendering.md @@ -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 ```