mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Dynamically load autocompletes
This cuts something like 100ms off of page load times! Closes #1011
This commit is contained in:
parent
8de74939ea
commit
9ab69adb38
10 changed files with 30 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue