From 8a39e73dfd015255e58d78dc4c31b05e1d206103 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 13 Nov 2019 13:30:39 +0800 Subject: [PATCH 1/2] Update personal_conferences_helper.rb add get_member_show method --- app/helpers/admin/personal_conferences_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/admin/personal_conferences_helper.rb b/app/helpers/admin/personal_conferences_helper.rb index a0518e6..52ce5b6 100644 --- a/app/helpers/admin/personal_conferences_helper.rb +++ b/app/helpers/admin/personal_conferences_helper.rb @@ -3,11 +3,14 @@ module Admin::PersonalConferencesHelper (writing_conference.authors.to_s.blank? ? get_member(writing_conference).collect(&:name).join('/') : Nokogiri::HTML(writing_conference.authors.to_s).text rescue '') end def get_authors_show(writing_conference) - (writing_conference.authors.to_s.blank? ? get_member(writing_conference).collect{|member| "#{member.name}"}.join('/') : writing_conference.authors.to_s rescue '') + (writing_conference.authors.to_s.blank? ? get_member_show(writing_conference) : writing_conference.authors.to_s rescue '') end def get_member(writing_conference) Array(MemberProfile.find(Array(writing_conference).collect(&:member_profile_id))) end + def get_member_show(writing_conference) + get_member(writing_conference).collect{|member| "#{member.name}"}.join('/') + end def get_sponsor(writing_conference) writing_conference.sponsor end From 587690b486c920add7f012dbfe11892c236fdcdb Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 13 Nov 2019 13:32:13 +0800 Subject: [PATCH 2/2] Update _writing_conference.html.erb fix showing author error for admin's index --- .../admin/writing_conferences/_writing_conference.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/writing_conferences/_writing_conference.html.erb b/app/views/admin/writing_conferences/_writing_conference.html.erb index 8dfd8f3..5c04059 100644 --- a/app/views/admin/writing_conferences/_writing_conference.html.erb +++ b/app/views/admin/writing_conferences/_writing_conference.html.erb @@ -10,6 +10,6 @@ - <%= writing_conference.member_profile.name rescue "" %> + <%= get_member_show(writing_conference).html_safe %> <% end %> \ No newline at end of file