From 61a8f79ca4b08091b0f9c197c9d248049602933b Mon Sep 17 00:00:00 2001 From: bohung Date: Thu, 15 Dec 2022 17:35:42 +0800 Subject: [PATCH] Fix link. --- app/models/experience.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/experience.rb b/app/models/experience.rb index 06c01ec..f24185f 100644 --- a/app/models/experience.rb +++ b/app/models/experience.rb @@ -75,9 +75,11 @@ class Experience pd_data = [] fields_to_show.collect do |t| if t == "organizationt_title" - pd_data << { "data_title" => "#{p.send(t)}" } + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_experience') + url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank) + tmp_title = p.organizationt_title + pd_data << { "data_title" => (url_to_plugin_show_blank ? tmp_title : "#{tmp_title}") } elsif t == "duration" - if !p.send('start_date').nil? or !p.send('end_date').nil? start_date = ((p.send('start_date').blank?) ? "" : p.send('start_date').strftime('%Y.%m')) rescue "" end_date = ((p.send('end_date').blank? || p.send('end_date').to_s == "0000-01-01" ) ? I18n.t('personal_experience.up_to_today') : p.send('end_date').strftime('%Y.%m')) rescue I18n.t('personal_experience.up_to_today')