Sha256: dbe4b6da13cfee8daf5ab7f224664e2da7a78b3ede70c6fa82db83d29a26a815
Contents?: true
Size: 533 Bytes
Versions: 18
Compression:
Stored size: 533 Bytes
Contents
module BivouacSample::Controllers class Autocomplete < R '/autocomplete' def get render :autocomplete end def post search_data = input.test_autocomplete data = [ 'Gregoire Lejeune', 'Arthur Lejeune', 'Colyne Lejeune', 'Benedict Lejeune', 'John Doe' ] @results = [ ] data.each do |name| @results << name if name.downcase.include?( search_data.downcase ) end render :_autocomplete_result end end end
Version data entries
18 entries across 18 versions & 1 rubygems