socialforge/app/controllers/school_controller.rb

18 lines
439 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>"
options << "<li><a id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
render :text => options
end
end