added target to patent link

This commit is contained in:
Harry Bomrah 2016-04-08 14:35:58 +08:00
parent 10fcff24b7
commit 83934a76f6
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class PersonalPatentsController < ApplicationController
fields_to_show.each do |fs|
case fs
when "patent_title"
t << {"value" => "<a href='#{OrbitHelper.url_to_show(patent.to_param)}'>" + (patent.send(fs) rescue "") + "</a>"}
t << {"value" => "<a href='#{OrbitHelper.url_to_show(patent.to_param)}' target='_blank'>" + (patent.send(fs) rescue "") + "</a>"}
when "publish_date"
t << {"value" => (patent.publish_date.strftime("%Y/%m/%d") rescue "")}
when "application_date"

View File

@ -140,7 +140,7 @@ class Patent
value = self.send(field) rescue ""
end
value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "<a href='#{value}' target='blank'>#{value}</a>" : value
value = (value =~ /\A#{URI::regexp(['http', 'https'])}\z/) ? "<a href='#{value}' target='_blank'>#{value}</a>" : value
{
"key"=>field,