forked from saurabh/personal-book
parent
7c338ff4bc
commit
4bc6962248
|
@ -39,6 +39,8 @@ class PersonalBooksController < ApplicationController
|
|||
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 "book_paper_type"
|
||||
books_show = books_temp.select {|value| search_all_words((value.book_type.title rescue ""), params[:keywords])}
|
||||
when "language"
|
||||
books_show = books_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])}
|
||||
else
|
||||
|
@ -71,6 +73,8 @@ class PersonalBooksController < ApplicationController
|
|||
t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")}
|
||||
when "language"
|
||||
t << {"value" => (!book.language.nil? ? t("#{book.language}") : "")}
|
||||
when "book_paper_type"
|
||||
t << {"value" => (book.book_type.title rescue "")}
|
||||
else
|
||||
t << {"value" => (book.send(fs) rescue "")}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue