aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/layouts_and_rendering.md
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-06-30 17:23:57 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-06-30 17:23:57 -0700
commit1feab8dac560289acb378783d545c7a4ba884f42 (patch)
tree39693c97f81281cd271bd1d8cddb430e6dad3735 /guides/source/layouts_and_rendering.md
parent683d7195c9b4256d82774d576e4b70628c079bd5 (diff)
parent93fd780a882555f6ae369ca5a445a47568bc5f1a (diff)
downloadrails-1feab8dac560289acb378783d545c7a4ba884f42.tar.gz
rails-1feab8dac560289acb378783d545c7a4ba884f42.tar.bz2
rails-1feab8dac560289acb378783d545c7a4ba884f42.zip
Merge pull request #11205 from Gawyn/using-preferred-find_by-syntax-in-guides
Using preferred find_by syntax in guides
Diffstat (limited to 'guides/source/layouts_and_rendering.md')
-rw-r--r--guides/source/layouts_and_rendering.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md
index f6cac997ff..5908801bc9 100644
--- a/guides/source/layouts_and_rendering.md
+++ b/guides/source/layouts_and_rendering.md
@@ -592,7 +592,7 @@ def index
end
def show
- @book = Book.find_by_id(params[:id])
+ @book = Book.find_by(id: params[:id])
if @book.nil?
render action: "index"
end
@@ -607,7 +607,7 @@ def index
end
def show
- @book = Book.find_by_id(params[:id])
+ @book = Book.find_by(id: params[:id])
if @book.nil?
redirect_to action: :index
end
@@ -626,7 +626,7 @@ def index
end
def show
- @book = Book.find_by_id(params[:id])
+ @book = Book.find_by(id: params[:id])
if @book.nil?
@books = Book.all
flash.now[:alert] = "Your book was not found"