fixed yes and no

This commit is contained in:
Harry Bomrah 2016-04-06 15:37:17 +08:00
parent 6374deebf5
commit 2b7f8da7e4
1 changed files with 4 additions and 2 deletions

View File

@ -94,9 +94,11 @@ class TechnologyTransfer
def get_plugin_field_data(field) def get_plugin_field_data(field)
case field case field
when "technology_transfer_category" when "technology_transfer_category"
value = self.technology_transfer_category.title rescue "" value = self.technology_transfer_category.title rescue ""
when "patent_granted"
value = self.patent_granted ? I18n.t("personal_technology_transfer.y_es") : I18n.t("personal_technology_transfer.n_o")
else else
value = self.send(field) rescue "" value = self.send(field) rescue ""
end 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