From 7c58b3fee64c72b23a58c1b190bd77cfc589bc77 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 20 Aug 2019 14:15:53 +0800 Subject: [PATCH] Update personal_books_controller.rb fix style --- app/controllers/personal_books_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 1d4fd1e..11964ee 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -48,11 +48,7 @@ class PersonalBooksController < ApplicationController else books_show = books_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end - page_to_show = if params[:page_no].nil? - 1 - else - params[:page_no].to_i - end + page_to_show = params[:page_no].nil? ? 1 : params[:page_no].to_i books = books_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] books_total_pages = (books_show.length / page_data_count.to_f).ceil else