globel issue#858, 中国高校--输入无效条件点击搜索,建议给出提示信息

This commit is contained in:
yanxd 2014-07-10 16:21:55 +08:00
parent e573438e43
commit 803e9cbdb5
3 changed files with 10 additions and 7 deletions

View File

@ -99,16 +99,17 @@ class SchoolController < ApplicationController
def search_school
q = "%#{params[:key_word].strip}%"
if params[:province].nil? or params[:province] == "0"
@school = School.where("name LIKE ?", q);
else
@school = School.where("province = ? AND name LIKE ?", params[:province], q);
end
@school = School.where("name LIKE ?", q)
@school = @school.where("province = ?", params[:province]) if (params[:province] != '0' )
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'> <a id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
render :text => options
options = "<div class='flash error' id='flash_error'>#{l(:label_school_not_fount)}</div>" if options.blank?
render :text => options
end
end

View File

@ -1469,6 +1469,7 @@ en:
label_teacher: Teacher
label_student: Student
label_school_all: Schools
label_school_not_fount: Not found by your input query condition.
label_other: Other
label_gender: Gender
label_gender_male: male

View File

@ -1857,6 +1857,7 @@ zh:
#added by Wen
label_school_all: 中国高校
label_school_not_fount: 没有符合的高校信息
label_project_grade: 项目得分