No commit activity in last 3 years
No release in over 3 years
Makes it trivial to build an autocomplete search feature into a web page.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.5, >= 1.5.2
 Project Readme

Introducing the jsautocomplete_builder gem

Usage

require 'jsautocomplete_builder' 

jab = JsAutocompleteBuilder.new(server: {list: 't205', action: 'hello3'})
#puts jab.to_webpage
File.write '/tmp/autocomplete.html', jab.to_webpage

The above example generates an autocomplete enabled web page. The suggestion list is fetched (using AJAX) from the relative URL at t205 and the search request is actioned using the relative URL hello3.

Here's a sample of what's returned from the AJAX request to t205:

<li tabindex='3' onblur='hideList()' onkeyup="itemKeyup(event.keyCode, this)"  onclick='itemSelected(this)'>apple</li>
<li tabindex='4' onblur='hideList()' onkeyup="itemKeyup(event.keyCode, this)" onclick='itemSelected(this)'>banana</li>
<li tabindex='5' onblur='hideList()' onkeyup="itemKeyup(event.keyCode, this)"  onclick='itemSelected(this)'>ghi</li>
<li tabindex='6' onblur='hideList()' onkeyup="itemKeyup(event.keyCode, this)"  onclick='itemSelected(this)'>jkl</li>

Resources

jsautocomplete_builder js builder ajax html autocomplete