From 93fd780a882555f6ae369ca5a445a47568bc5f1a Mon Sep 17 00:00:00 2001 From: Cristian Planas Date: Mon, 1 Jul 2013 01:38:46 +0200 Subject: Using preferred find_by syntax in guides --- guides/source/layouts_and_rendering.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides/source/layouts_and_rendering.md') 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" -- cgit v1.2.3