From cbc46d3031905f0927c456e2c03ac7d7c1c974a5 Mon Sep 17 00:00:00 2001 From: JiangRu Date: Fri, 13 Feb 2015 15:43:46 +0800 Subject: [PATCH] fix book_type nil --- app/controllers/personal_books_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 657f6d4..97195a3 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -6,7 +6,7 @@ class PersonalBooksController < ApplicationController "book_title" => book.create_link, "author" => book.authors, "year" => book.year, - "book_paper_type" => book.book_type.title, + "book_paper_type" => (book.book_type.title rescue nil), "link_to_show" => OrbitHelper.url_to_show(book.to_param) } end