Update personal_books_controller.rb

fix error
This commit is contained in:
chiu 2019-08-15 09:59:22 +08:00
parent cbd05be1ea
commit d004d722ca
1 changed files with 6 additions and 1 deletions

View File

@ -29,8 +29,13 @@ class PersonalBooksController < ApplicationController
books_temp = Book.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } books_temp = Book.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }
case params[:selectbox] case params[:selectbox]
when "book_title", "extracted_chapters", "default" when "book_title", "extracted_chapters", "default"
if params[:selectbox]=="dafault"
search_temp="book_title"
else
search_temp=params[:selectbox]
end
if page.custom_string_field == "table" if page.custom_string_field == "table"
books_show = books_temp.select {|value| search_all_words(value.send(params[:selectbox]), params[:keywords])} books_show = books_temp.select {|value| search_all_words(value.send(search_temp), params[:keywords])}
else else
books_show = books_temp.select {|value| search_all_words(value.create_link, params[:keywords])} books_show = books_temp.select {|value| search_all_words(value.create_link, params[:keywords])}
end end