handle nil in frontend
This commit is contained in:
parent
363ef493bd
commit
b5aa87fc7e
|
@ -42,14 +42,14 @@ class PersonalPatentsController < ApplicationController
|
||||||
|
|
||||||
"data" => {
|
"data" => {
|
||||||
"patent_title" => patent.patent_title,
|
"patent_title" => patent.patent_title,
|
||||||
"patent_type" => patent.patent_type.title,
|
"patent_type" => (patent.patent_type.title rescue ""),
|
||||||
"authors" => patent.authors,
|
"authors" => patent.authors,
|
||||||
"year" => patent.year,
|
"year" => patent.year,
|
||||||
"language" => t(patent.language),
|
"language" => (t(patent.language) rescue ""),
|
||||||
"keywords" => patent.keywords,
|
"keywords" => patent.keywords,
|
||||||
"patent_no" => patent.patent_no,
|
"patent_no" => patent.patent_no,
|
||||||
"patent_country" => patent.patent_country,
|
"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,
|
"url" => patent.url,
|
||||||
"note" => patent.note,
|
"note" => patent.note,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue