diff options
author | Brian Kim <briankimpossible@gmail.com> | 2013-02-18 14:20:37 -0500 |
---|---|---|
committer | Brian Kim <briankimpossible@gmail.com> | 2013-02-18 14:27:25 -0500 |
commit | f9f6fc7a91fecc7a52c812d2900b9ae5d4636743 (patch) | |
tree | e1aa7c4b0388a08b075d0d1f0b45fb53e6edc623 /guides | |
parent | 8743f800db529ef21a757b70230527fdae0691cc (diff) | |
download | rails-f9f6fc7a91fecc7a52c812d2900b9ae5d4636743.tar.gz rails-f9f6fc7a91fecc7a52c812d2900b9ae5d4636743.tar.bz2 rails-f9f6fc7a91fecc7a52c812d2900b9ae5d4636743.zip |
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.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/layouts_and_rendering.md | 3 |
1 files changed, 2 insertions, 1 deletions
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 ``` |