Hi -
I''m trying to modify auto_complete_for to allow a foreign table to be
the source of the lookup strings. It''s currently defined as:
def auto_complete_for(object, method, options = {})
which tells me I can simply add a "foreign" argument at the end of my
call and it will be auto-added to the options array (is this right?).
So, now I change:
@items = object.to_s.camelize.constantize.find(:all, find_options)
to
options[:foreign] ? @items
options[:foreign].to_s.camelize.constantize.find(:all, find_options) :
@items = object.to_s.camelize.constantize.find(:all, find_options)
And in my controller, I call:
auto_complete_for :story, :tag_holder, :foreign => ''tag''
But i get this error in the log:
ArgumentError (Unknown key(s): foreign):
Can someone explain options hash and what''s wrong here?
Thanks,
Dino
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---