Update personal_books_controller.rb
This commit is contained in:
parent
3204aa0b7d
commit
44ed0018a8
|
@ -37,7 +37,7 @@ class PersonalBooksController < ApplicationController
|
||||||
when "author_type"
|
when "author_type"
|
||||||
books_show = books_temp.select {|value| value.book_author_types.collect{|bat| bat.title}.join(", ").include? params[:keywords]}
|
books_show = books_temp.select {|value| value.book_author_types.collect{|bat| bat.title}.join(", ").include? params[:keywords]}
|
||||||
when "language"
|
when "language"
|
||||||
books_show = books_temp.select {|value| (!value.language.nil? ? I18n.t("personal_book.#{value.language}") : "").include? params[:keywords]}
|
books_show = books_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").include? params[:keywords]}
|
||||||
else
|
else
|
||||||
books_show = books_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]}
|
books_show = books_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]}
|
||||||
end
|
end
|
||||||
|
@ -64,11 +64,11 @@ class PersonalBooksController < ApplicationController
|
||||||
t << {"value" => "<a href='#{OrbitHelper.url_to_show(book.to_param)}'>#{book.create_link}</a>"}
|
t << {"value" => "<a href='#{OrbitHelper.url_to_show(book.to_param)}'>#{book.create_link}</a>"}
|
||||||
end
|
end
|
||||||
when "publish_date", "publication_date"
|
when "publish_date", "publication_date"
|
||||||
t << {"value" => "book.publication_date.strftime('%Y/%m/%d')"}
|
t << {"value" => (!book.publication_date.nil? ? book.publication_date.strftime('%Y/%m/%d') : "")}
|
||||||
when "author_type"
|
when "author_type"
|
||||||
t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")}
|
t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")}
|
||||||
when "language"
|
when "language"
|
||||||
t << {"value" => (!book.language.nil? ? t("#{book.language}") : "" rescue "")}
|
t << {"value" => (!book.language.nil? ? t("#{book.language}") : "")}
|
||||||
else
|
else
|
||||||
t << {"value" => book.send(fs)}
|
t << {"value" => book.send(fs)}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue