diff --git a/app/models/employer_profile.rb b/app/models/employer_profile.rb index 3de333f..e57dc22 100644 --- a/app/models/employer_profile.rb +++ b/app/models/employer_profile.rb @@ -29,6 +29,20 @@ class EmployerProfile end end + def get_company_name + if self.company_name.empty? + case I18n.locale + when :en + cname = self.company_name_translations["zh_tw"] + when :zh_tw + cname = self.company_name_translations["en"] + end + else + cname = self.company_name + end + return cname + end + def get_industry RecruitmentIndustry.find(self.industry).industry_title rescue "" end diff --git a/app/views/admin/recruitments/_member_index.html.erb b/app/views/admin/recruitments/_member_index.html.erb index c1ddff1..9531c5c 100644 --- a/app/views/admin/recruitments/_member_index.html.erb +++ b/app/views/admin/recruitments/_member_index.html.erb @@ -17,7 +17,7 @@ <% if user.is_employee? %> " target="_blank" ><%= user.name %> <% elsif user.is_employer? %> - <%= user.profile.company_name %> + <%= user.profile.get_company_name %> <% end %>