From 05a285a47284648bfed3607eb5d24b9541136960 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 11:20:54 +0800 Subject: [PATCH] Update personal_projects_controller.rb fix language not translated --- app/controllers/personal_projects_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index ed546c1..4c4245e 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -28,6 +28,8 @@ class PersonalProjectsController < ApplicationController projects_show = projects_temp.select {|value| search_all_words(value.send("project_title").to_s, params[:keywords])} when "period" projects_show = projects_temp.select {|value| search_all_words(value.send("duration").to_s, params[:keywords])} + when "language" + projects_show = projects_temp.select {|value| search_all_words(t(value.send("language")), params[:keywords])} else projects_show = projects_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords])} end @@ -52,6 +54,8 @@ class PersonalProjectsController < ApplicationController t << {"value" => "" + (project.send(fs) rescue "") + ""} when "period" t << {"value" => (project.send("duration") rescue "")} + when "language" + t << {"value" => (t(project.send("language")) rescue "")} else t << {"value" => (project.send(fs) rescue "")} end