2014-03-21 18:02:55 +08:00
|
|
|
class SchoolController < ApplicationController
|
2014-04-15 16:57:19 +08:00
|
|
|
def get_options
|
|
|
|
@school = School.where("province = ?", params[:province])
|
|
|
|
p = params[:province]
|
|
|
|
##@school = School.all
|
|
|
|
options = ""
|
|
|
|
|
|
|
|
@school.each do |s|
|
|
|
|
options << "<option value=#{s.name}>#{s.name}</option>"
|
|
|
|
end
|
|
|
|
|
|
|
|
render :text => options
|
|
|
|
|
|
|
|
end
|
2014-03-21 18:02:55 +08:00
|
|
|
end
|