parent
0be2c149a4
commit
45a0f6cf2c
@ -1,8 +1,12 @@
|
|||||||
class SchoolsController < ApplicationController
|
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
|
||||||
|
|
||||||
def school_list
|
render_ok(school_names: schools.pluck(:name))
|
||||||
q = params[:search] ? params[:search].strip : ""
|
|
||||||
@schools = School.where("name like ?", "%#{q}%").pluck(:name)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1 +0,0 @@
|
|||||||
json.shools_name @schools
|
|
Loading…
Reference in new issue