From 19e851d65af0e94b90ddb739bb83c021b2d8eeaa Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 12 May 2014 08:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=B3=A8=E5=86=8C=E9=AA=8C?= =?UTF-8?q?=E8=AF=81ajax=EF=BC=8C=E8=AF=BE=E7=A8=8B=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E7=9A=84=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/school.rb | 4 ++++ app/views/layouts/base_courses.html.erb | 2 +- config/routes.rb | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/school.rb b/app/models/school.rb index 7dbf5e3a8..a180eefbe 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -1,4 +1,8 @@ class School < ActiveRecord::Base attr_accessible :name, :province has_many :courses + + def to_s + self.name.to_s + end end diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 968752ed5..41e0c2a12 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -160,7 +160,7 @@ <% unless @course.teacher.user_extensions.nil?%> - <%= l(:label_teacher_work_unit) %> :<%= @course.teacher.user_extensions.occupation %> + <%= l(:label_teacher_work_unit) %> :<%= @course.teacher.user_extensions.school %> <% else %> diff --git a/config/routes.rb b/config/routes.rb index a64acb2c6..62d773077 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -127,6 +127,7 @@ RedmineApp::Application.routes.draw do match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register' match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password' match 'account/activate', :to => 'account#activate', :via => :get + match 'account/valid_ajax', :to => 'account#valid_ajax', :via => :get match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put] match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put]