Dynamically load autocompletes

This cuts something like 100ms off of page load times!

Closes #1011
This commit is contained in:
Eric Allen 2010-04-02 13:23:24 -04:00
parent 8de74939ea
commit 9ab69adb38
10 changed files with 30 additions and 24 deletions

View file

@ -123,6 +123,11 @@ class ApplicationController < ActionController::Base
formatted_date
end
def for_autocomplete(coll)
coll.map {|item| "#{item.name}|#{item.id}"}.join("\n")
end
# Uses RedCloth to transform text using either Textile or Markdown Need to
# require redcloth above RedCloth 3.0 or greater is needed to use Markdown,
# otherwise it only handles Textile