mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
migrate adding to actions on all pages
This commit is contained in:
parent
25c6e2cc9c
commit
e13e946295
24 changed files with 356 additions and 276 deletions
|
|
@ -136,7 +136,8 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def for_autocomplete(coll, substr)
|
||||
filtered = coll.find_all{|item| item.name.downcase.include? substr.downcase}
|
||||
return "[{" + filtered.map {|item| "\"value\"=\"#{item.name}\", \"id\"=\"#{item.id}\""}.join("},{") + "}]"
|
||||
json_elems = "[{" + filtered.map {|item| "\"value\" : \"#{item.name}\", \"id\" : \"#{item.id}\""}.join("},{") + "}]"
|
||||
return json_elems == "[{}]" ? "" : json_elems
|
||||
end
|
||||
|
||||
# Uses RedCloth to transform text using either Textile or Markdown Need to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue