1,jQueryAutoComplete
http://rorplugin.googlecode.com/svn/trunk/jquery_auto_complete/
jQueryAutoComplete is a jQuery-based Ruby on Rails AutoComplete plugin.
jQueryAutoComplete lets you push a JavaScript Array to the front page for auto-completion to use.
jQueryAutoComplete's style is easy to modify, please refer to public/stylesheets/jquery.autocomplete.css
============
Usage:
2,PrototypeAutoComplete
http://rorplugin.googlecode.com/svn/trunk/prototype_auto_complete/
PrototypeAutoComplete is a Prototype-based Ruby on Rails AutoComplete plugin.
PrototypeAutoComplete lets you push a JavaScript Array to the front page for auto-completion to use.
PrototypeAutoComplete's style is easy to modify, please refer to public/stylesheets/prototype.autocomplete.css
============
Usage:
Screenshot:
http://rorplugin.googlecode.com/svn/trunk/jquery_auto_complete/
jQueryAutoComplete is a jQuery-based Ruby on Rails AutoComplete plugin.
jQueryAutoComplete lets you push a JavaScript Array to the front page for auto-completion to use.
jQueryAutoComplete's style is easy to modify, please refer to public/stylesheets/jquery.autocomplete.css
============
Usage:
- ======================
- books_controller.rb:
- --------
- def books_for_lookup
- @books = Book.find(:all)
- @headers['content-type'] = 'text/javascript'
- render :layout => false
- end
- ======================
- books_for_lookup.rhtml:
- --------
- var books = [];
- <% @books.each do |book|%>
- books.push("<%= book.name %>");
- <% end %>
- ======================
- books.rhtml:
- --------
- <head>
- <%= auto_complete_include "/books_for_lookup" %>
- </head>
- ======================
- search.rhtml:
- --------
- <div id="content">
- <p>
- <label>Books:</label>
- <input type="text" id="suggest1" />
- </p>
- </div>
- <%= auto_complete("suggest1", "books") %>
- ------------------
====================== books_controller.rb: -------- def books_for_lookup @books = Book.find(:all) @headers['content-type'] = 'text/javascript' render :layout => false end ====================== books_for_lookup.rhtml: -------- var books = []; <% @books.each do |book|%> books.push("<%= book.name %>"); <% end %> ====================== books.rhtml: -------- <head> <%= auto_complete_include "/books_for_lookup" %> </head> ====================== search.rhtml: -------- <div id="content"> <p> <label>Books:</label> <input type="text" id="suggest1" /> </p> </div> <%= auto_complete("suggest1", "books") %> ------------------
2,PrototypeAutoComplete
http://rorplugin.googlecode.com/svn/trunk/prototype_auto_complete/
PrototypeAutoComplete is a Prototype-based Ruby on Rails AutoComplete plugin.
PrototypeAutoComplete lets you push a JavaScript Array to the front page for auto-completion to use.
PrototypeAutoComplete's style is easy to modify, please refer to public/stylesheets/prototype.autocomplete.css
============
Usage:
- ======================
- books_controller.rb:
- --------
- def books_for_lookup
- @books = Book.find(:all)
- @headers['content-type'] = 'text/javascript'
- render :layout => false
- end
- ======================
- books_for_lookup.rhtml:
- --------
- var books = [];
- <% @books.each do |book|%>
- books.push("<%= book.name %>");
- <% end %>
- ======================
- books.rhtml:
- --------
- <head>
- <%= auto_complete_include "/books_for_lookup" %>
- </head>
- ======================
- search.rhtml:
- --------
- <div id="content">
- <p>
- <label>Books:</label>
- <input type="text" id="suggest1" />
- </p>
- </div>
- <%= auto_complete("suggest1", "books") %>
- ------------------
====================== books_controller.rb: -------- def books_for_lookup @books = Book.find(:all) @headers['content-type'] = 'text/javascript' render :layout => false end ====================== books_for_lookup.rhtml: -------- var books = []; <% @books.each do |book|%> books.push("<%= book.name %>"); <% end %> ====================== books.rhtml: -------- <head> <%= auto_complete_include "/books_for_lookup" %> </head> ====================== search.rhtml: -------- <div id="content"> <p> <label>Books:</label> <input type="text" id="suggest1" /> </p> </div> <%= auto_complete("suggest1", "books") %> ------------------
Screenshot:
