Update personal_books_controller.rb

This commit is contained in:
chiu 2019-08-14 16:03:44 +08:00
parent f9f6108f30
commit 6d3b6f5fcb
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class PersonalBooksController < ApplicationController
books_show = books_temp.select {|value| value.create_link.include? params[:keywords]}
end
when "publish_date", "publication_date"
books_show = books_temp.select {|value| value.publish_date.strftime("%Y/%m/%d").to_s.include? params[:keywords]}
books_show = books_temp.select {|value| value.send(params[:selectbox]).strftime("%Y/%m/%d").to_s.include? params[:keywords]}
when "author_type"
books_show = books_temp.select {|value| value.book_author_types.collect{|bat| bat.title}.join(", ").include? params[:keywords]}
when "language"
@ -64,7 +64,7 @@ class PersonalBooksController < ApplicationController
t << {"value" => "<a href='#{OrbitHelper.url_to_show(book.to_param)}'>#{book.create_link}</a>"}
end
when "publish_date", "publication_date"
t << {"value" => (!book.publish_date.nil? ? book.publish_date.strftime('%Y/%m') : "")}
t << {"value" => (!book.send(fs).nil? ? book.send(fs).strftime('%Y/%m') : "")}
when "author_type"
t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")}
when "language"