handle nil in frontend

This commit is contained in:
manson 2014-07-15 19:09:28 +08:00
parent 363ef493bd
commit b5aa87fc7e
1 changed files with 3 additions and 3 deletions

View File

@ -42,14 +42,14 @@ class PersonalPatentsController < ApplicationController
"data" => {
"patent_title" => patent.patent_title,
"patent_type" => patent.patent_type.title,
"patent_type" => (patent.patent_type.title rescue ""),
"authors" => patent.authors,
"year" => patent.year,
"language" => t(patent.language),
"language" => (t(patent.language) rescue ""),
"keywords" => patent.keywords,
"patent_no" => patent.patent_no,
"patent_country" => patent.patent_country,
"publish_date" => patent.publish_date.strftime("%Y.%m"),
"publish_date" => (patent.publish_date.strftime("%Y.%m") rescue ""),
"url" => patent.url,
"note" => patent.note,