Update personal_books_controller.rb
This commit is contained in:
parent
0a95f1e957
commit
ad892f6e0f
|
@ -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" => "<a href='#{OrbitHelper.url_to_show(book.to_param)}'>#{book.create_link}</a>"}
|
||||
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"
|
||||
|
|
Loading…
Reference in New Issue