Update journal_papers_helper.rb

This commit is contained in:
chiu 2019-11-02 14:09:29 +08:00
parent 5155427305
commit 1bba50e692
1 changed files with 2 additions and 2 deletions

View File

@ -1,9 +1,9 @@
module Admin::JournalPapersHelper
def get_authors_text(journal)
journal.authors.to_s.blank? ? get_member(journal).collect(&:name).join('/') : Nokogiri::HTML(journal.authors.to_s).text
(journal.authors.to_s.blank? ? get_member(journal).collect(&:name).join('/') : Nokogiri::HTML(journal.authors.to_s).text rescue "")
end
def get_authors_show(journal)
journal.authors.to_s.blank? ? get_member(journal).collect(&:name).join('/') : (journal.authors.to_s)
(journal.authors.to_s.blank? ? get_member(journal).collect{|member| "<a href='#{OrbitHelper.url_to_show(member.to_param)}' title='#{member.name}'>#{member.name}</a>"}.join('/') : (journal.authors.to_s) rescue "")
end
def get_member(journal)
Array(MemberProfile.find(Array(journal).collect(&:member_profile_id)))