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

Version Path
bivouac-0.0.7 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.0.9 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.1 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.0 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.0.8 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.3 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.2 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.4 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.5 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.1.6 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.2.0 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.2.2 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.2.3 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.2.1 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.2.4 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.2.5 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.4.0 examples/bivouac_sample/app/controllers/autocomplete.rb
bivouac-0.3.0 examples/bivouac_sample/app/controllers/autocomplete.rb