Merge branch 'dev_course' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_course
commit
7261f7ab04
@ -1,8 +1,12 @@
|
||||
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
|
||||
q = params[:search] ? params[:search].strip : ""
|
||||
@schools = School.where("name like ?", "%#{q}%").pluck(:name)
|
||||
render_ok(school_names: schools.pluck(:name))
|
||||
end
|
||||
end
|
||||
|
@ -1 +0,0 @@
|
||||
json.shools_name @schools
|
Loading…
Reference in new issue