socialforge/app/controllers/school_controller.rb

35 lines
806 B
Ruby
Raw Normal View History

class SchoolController < ApplicationController
2014-04-23 21:20:03 +08:00
def index
end
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|
2014-04-23 09:22:13 +08:00
#options << "<option value=#{s.id}>#{s.name}</option>"
2014-04-23 21:20:03 +08:00
options << "<li style = 'width: 33%; float: left'><a id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
2014-04-15 16:57:19 +08:00
end
2014-04-23 09:22:13 +08:00
2014-04-15 16:57:19 +08:00
render :text => options
end
2014-04-23 21:20:03 +08:00
def get_schoollist
@school = School.where("province = ?", params[:province])
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
end
end