From 649e16793c7d805d4849e2e8c8aa31f85cc5d95c Mon Sep 17 00:00:00 2001 From: bohung Date: Thu, 15 Dec 2022 17:33:19 +0800 Subject: [PATCH] Fix link. --- app/models/course.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 70b8b9c..9807086 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -96,9 +96,10 @@ class Course pd_data = [] fields_to_show.collect do |t| if t == "title" - link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_course') - link = (link == "#" ? p.send(t) : "#{p.send(t)}") - pd_data << { "data_title" => link } + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_course') + url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank) + tmp_title = p.title + pd_data << { "data_title" => (url_to_plugin_show_blank ? tmp_title : "#{tmp_title}") } elsif t == "course_category" pd_data << {"data_title" => (p.course_category.title rescue "")} else