Skip to content

Commit

Permalink
Fix bug in code example from layouts and rendering guide
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brainkim committed Feb 18, 2013
1 parent 8743f80 commit f9f6fc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion guides/source/layouts_and_rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down

2 comments on commit f9f6fc7

@lintzchiang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it use flash.now?

@carlosantoniodasilva
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, just fixed bd277ac, thanks!

Please sign in to comment.