get tag view working for updating todos. Refactored update a lot

This commit is contained in:
Reinier Balt 2011-01-01 18:55:53 +01:00
parent 1cea27ccc9
commit f923a40a40
15 changed files with 314 additions and 215 deletions

View file

@ -124,16 +124,9 @@ class ApplicationController < ActionController::Base
# config/settings.yml
#
def format_date(date)
if date
date_format = prefs.date_format
formatted_date = date.in_time_zone(prefs.time_zone).strftime("#{date_format}")
else
formatted_date = ''
end
formatted_date
return date ? date.in_time_zone(prefs.time_zone).strftime("#{prefs.date_format}") : ''
end
def for_autocomplete(coll, substr)
filtered = coll.find_all{|item| item.name.downcase.include? substr.downcase}
json_elems = "[{" + filtered.map {|item| "\"value\" : \"#{item.name}\", \"id\" : \"#{item.id}\""}.join("},{") + "}]"