Update book.rb

fix error
This commit is contained in:
chiu 2019-08-19 16:49:50 +08:00
parent 7f4b994670
commit ea1be9befa
1 changed files with 2 additions and 2 deletions

View File

@ -171,8 +171,8 @@ class Book
files = []
self.book_files.each do |book_file|
url = book_file.member_book_file.url
title = (book_file.title.blank? ? File.basename(book_file.member_book_file.path) : book_file.title)
files << "<li><a href='#{url}'' target='_blank'>#{title}</li>"
title = ((book_file.title.blank? ? File.basename(book_file.member_book_file.path) : book_file.title) rescue "")
files << (url.nil? ? "" : "<li><a href='#{url}'' target='_blank'>#{title}</li>")
end
value = files.join("")
else