Skip to content

Commit

Permalink
auto_complete field value even if foreign_key
Browse files Browse the repository at this point in the history
  • Loading branch information
kfl62 committed Mar 17, 2009
1 parent 5fd85f4 commit eb91115
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/forms/application_helper.rb
Expand Up @@ -87,7 +87,7 @@ def last_row_for(object_name,method, options = {})
def td_auto_complete_search(object_name,method, options = {})
habtm_value = ""
if method.to_s.split("_").last == "id"
habtm_field = method.to_s.gsub(/_id/, "")
habtm_field = options[:search_object].underscore
habtm_method = options[:informal] ? options[:informal] : options[:search_method]
habtm_value = options[:object].send(habtm_field).send(habtm_method) rescue habtm_value = ""
end
Expand Down

0 comments on commit eb91115

Please sign in to comment.