mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
replace old prototype/jrails code for periodic checks and start work on autocomplete and edit projects
Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
69c811e365
commit
c834403340
24 changed files with 588 additions and 53 deletions
|
|
@ -136,7 +136,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def for_autocomplete(coll, substr)
|
||||
filtered = coll.find_all{|item| item.name.downcase.include? substr.downcase}
|
||||
return filtered.map {|item| "#{item.name}|#{item.id}"}.join("\n")
|
||||
return "[{" + filtered.map {|item| "\"value\"=\"#{item.name}\", \"id\"=\"#{item.id}\""}.join("},{") + "}]"
|
||||
end
|
||||
|
||||
# Uses RedCloth to transform text using either Textile or Markdown Need to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue