socialforge/app/controllers/school_controller.rb

16 lines
342 B
Ruby
Raw Normal View History

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.id}>#{s.name}</option>"
2014-04-15 16:57:19 +08:00
end
render :text => options
end
end