From d5ae586a4bd43c6e6fdc17d22f63770b6805c6b5 Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 2 Nov 2019 11:37:36 +0800 Subject: [PATCH] Update journal_papers_helper.rb --- app/helpers/admin/journal_papers_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/helpers/admin/journal_papers_helper.rb b/app/helpers/admin/journal_papers_helper.rb index 518e177..bd97350 100644 --- a/app/helpers/admin/journal_papers_helper.rb +++ b/app/helpers/admin/journal_papers_helper.rb @@ -1,4 +1,10 @@ module Admin::JournalPapersHelper + def get_authors_text(journal) + journal.authors.to_s.blank? ? get_member(journal).join('/') : Nokogiri::HTML(journal.authors.to_s).text + end + def get_authors_show(journal) + journal.authors.to_s.blank? ? get_member(journal).join('/') : (journal.authors.to_s) + end def get_member(journal) Array(MemberProfile.find(Array(journal).collect(&:member_profile_id))) end