From 83934a76f6ba16630b3c4b16e497e4dd9a6ce9c6 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 8 Apr 2016 14:35:58 +0800 Subject: [PATCH] added target to patent link --- app/controllers/personal_patents_controller.rb | 2 +- app/models/patent.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_patents_controller.rb b/app/controllers/personal_patents_controller.rb index 8149aff..025468f 100644 --- a/app/controllers/personal_patents_controller.rb +++ b/app/controllers/personal_patents_controller.rb @@ -18,7 +18,7 @@ class PersonalPatentsController < ApplicationController fields_to_show.each do |fs| case fs when "patent_title" - t << {"value" => "" + (patent.send(fs) rescue "") + ""} + t << {"value" => "" + (patent.send(fs) rescue "") + ""} when "publish_date" t << {"value" => (patent.publish_date.strftime("%Y/%m/%d") rescue "")} when "application_date" diff --git a/app/models/patent.rb b/app/models/patent.rb index 7d2f113..02b71fa 100644 --- a/app/models/patent.rb +++ b/app/models/patent.rb @@ -140,7 +140,7 @@ class Patent value = self.send(field) rescue "" end - value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "#{value}" : value + value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "#{value}" : value { "key"=>field,