Update personal_projects_controller.rb

fix language not translated
This commit is contained in:
chiu 2019-08-15 11:20:54 +08:00
parent aa35cd4de6
commit 05a285a472
1 changed files with 4 additions and 0 deletions

View File

@ -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" => "<a href='#{OrbitHelper.url_to_show(project.to_param)}'>" + (project.send(fs) rescue "") + "</a>"}
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