diff --git a/app/helpers/admin/personal_books_helper.rb b/app/helpers/admin/personal_books_helper.rb index 7468ce4..83c6c71 100644 --- a/app/helpers/admin/personal_books_helper.rb +++ b/app/helpers/admin/personal_books_helper.rb @@ -1,5 +1,5 @@ module Admin::PersonalBooksHelper - def get_authors_text(book) + def get_authors_text(book) authors_text = Nokogiri::HTML(book.authors.to_s).text split_text = authors_text.match(/[、,,\/]/) split_text = split_text.nil? ? '/' : split_text[0] @@ -9,8 +9,8 @@ module Admin::PersonalBooksHelper full_authors_names += authors_names end full_authors_names.join(split_text) - end - def get_authors_show(book) + end + def get_authors_show(book) authors_text = Nokogiri::HTML(book.authors.to_s).text split_text = authors_text.match(/[、,,\/]/) split_text = split_text.nil? ? '/' : split_text[0] @@ -25,25 +25,25 @@ module Admin::PersonalBooksHelper full_authors += authors_names end full_authors.join(split_text) - end - def get_member(book) - Array(MemberProfile.where(:id.in=>Array(book).collect(&:member_profile_id).flatten)) - end - def get_member_show(book) - get_member(book).collect{|member| "#{member.name}"}.join('/') - end - def get_publisher(book) - book.publisher - end - def get_author_type(book) - book.book_author_types.collect(&:title).join(', ') rescue '' - end - def get_paper_type(book) - !book.book_type.blank? ? book.book_type.title : nil - end - def get_publication_date(book) - book.publication_date.strftime('%Y/%m/%d') rescue '' - end + end + def get_member(book) + Array(MemberProfile.where(:id.in=>Array(book).collect(&:member_profile_id).flatten)) + end + def get_member_show(book) + get_member(book).collect{|member| "#{member.name}"}.join('/') + end + def get_publisher(book) + book.publisher + end + def get_author_type(book) + book.book_author_types.collect(&:title).join(', ') rescue '' + end + def get_paper_type(book) + !book.book_type.blank? ? book.book_type.title : nil + end + def get_publication_date(book) + book.publication_date.strftime('%Y/%m/%d') rescue '' + end def get_paper_list user = current_user.nil? ? OrbitHelper.current_user : current_user user_profile = user.member_profile