You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
class SchoolsController < ApplicationController
|
|
def school_list
|
|
schools = School.all
|
|
|
|
search = params[:search].to_s.strip
|
|
if search.present?
|
|
schools = schools.where('name Like ?', "%#{search}%")
|
|
end
|
|
|
|
render_ok(school_names: schools.pluck(:name))
|
|
end
|
|
end
|