From f8c6d7d77ed8f2c2b61ef903b575ef456bd36b3d Mon Sep 17 00:00:00 2001 From: Wen Date: Wed, 23 Apr 2014 09:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=97=B6=E5=AD=A6=E6=A0=A1?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=9A=84=E5=B0=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 6233772f4..2e70b2454 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -109,9 +109,15 @@

- <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %> + <% unless User.current.user_extensions.school_id.nil? %> + <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onchange => "get_options(this.value)" %> - <%= select_tag "occupation" %> + <%= select_tag "occupation", options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %> + <% else %> + <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %> + + <%= select_tag "occupation" %> + <% end %>