get dependency add/remove from new_action_form running

This commit is contained in:
Reinier Balt 2011-02-12 10:38:15 +01:00
parent 92fdef2b1b
commit 1f67d2a603
7 changed files with 93 additions and 95 deletions

View file

@ -36,7 +36,6 @@ class ApplicationController < ActionController::Base
before_filter :set_locale
prepend_before_filter :login_required
prepend_before_filter :enable_mobile_content_negotiation
# after_filter :set_locale
after_filter :set_charset
include ActionView::Helpers::TextHelper
@ -137,8 +136,8 @@ class ApplicationController < ActionController::Base
end
end
def auto_complete_result2(entries, phrase = nil)
json_elems = "[{" + entries.map {|item| "\"id\" : \"#{item.id}\", \"value\" : \"#{item.specification()}\""}.join("},{") + "}]"
def format_dependencies_as_json_for_auto_complete(entries)
json_elems = "[{" + entries.map {|item| "\"value\" : \"#{item.id}\", \"label\" : \"#{item.specification()}\""}.join("},{") + "}]"
return json_elems == "[{}]" ? "" : json_elems
end