socialforge/app/controllers/school_controller.rb

16 lines
342 B
Ruby

class SchoolController < ApplicationController
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>"
end
render :text => options
end
end