migrate adding to actions on all pages

This commit is contained in:
Reinier Balt 2010-12-17 16:01:22 +01:00
parent 25c6e2cc9c
commit e13e946295
24 changed files with 356 additions and 276 deletions

View file

@ -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