diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 488d562..85288a2 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -40,7 +40,7 @@ class PersonalBooksController < ApplicationController books_show = books_temp.select {|value| search_all_words(value.create_link, params[:keywords])} end when "publish_date", "publication_date" - books_show = books_temp.select {|value| search_all_words(value.send(params[:selectbox]).strftime("%Y/%m/%d").to_s, params[:keywords])} + books_show = books_temp.select {|value| search_all_words((value.send(params[:selectbox]).strftime("%Y/%m/%d") rescue ""), params[:keywords])} when "author_type" books_show = books_temp.select {|value| search_all_words(value.book_author_types.collect{|bat| bat.title}.join(", "), params[:keywords])} when "language" @@ -70,7 +70,7 @@ class PersonalBooksController < ApplicationController t << {"value" => "#{book.create_link}"} end when "publish_date", "publication_date" - t << {"value" => (!book.send(fs).nil? ? book.send(fs).strftime('%Y/%m') : "")} + t << {"value" => (!book.send(fs).nil? ? book.send(fs).strftime('%Y/%m') : "" rescue "")} when "author_type" t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")} when "language"