Sha256: c7b7f0a9a3e79600b56f5f8be9e1703232b887d902cc4c4bb521bb562463370c
Contents?: true
Size: 436 Bytes
Versions: 20
Compression:
Stored size: 436 Bytes
Contents
module Gaku class SearchController < GakuController respond_to :json, only: :search def students if params[:class_name] object = "Gaku::#{params[:class_name].classify}".constantize @result = object.order(params[:column].to_sym) .where(params[:column] + ' like ?', "%#{params[:term]}%") render json: @result.map(¶ms[:column].to_sym).uniq end end end end
Version data entries
20 entries across 20 versions & 2 rubygems