From 2780fbf64614c88db44111fc5b8851ffc6cba7cb Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 20 Aug 2019 14:16:20 +0800 Subject: [PATCH] Update personal_projects_controller.rb fix style --- app/controllers/personal_projects_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index d574afd..cfcda10 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -29,11 +29,7 @@ class PersonalProjectsController < ApplicationController else projects_show = projects_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 projects = projects_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] projects_total_pages = (projects_show.length / page_data_count.to_f).ceil else