Hi-
I am trying to understand how auto_complete works. The docs don’t
tell me what each parameter is, they all assume I know what they are.
All I want to do is have a form that contains news stories that you
can tag, with the tag suggestions coming from the tags table.
In one example ( http://agilewebdevelopment.com/plugins/auto_complete
) he says:
Controller
class BlogController < ApplicationController
auto_complete_for :post, :title
endView
<%= text_field_with_auto_complete :post, title %>
Here, you have the controller class, Blog, and post, and title. What
are these? Is post the name of an existing object? Is title the
field of a class?
In another example (
http://trix.pl/blog/ruby-on-rails/auto-complete-for-rails-2-0-tutorial
) , he says:
class DomainsController < ApplicationController
auto_complete_for :domain, :name
here, the controller name is the same as the first param of the
method.
It’s all so confusing.
Anyway, can someone break down what the parameters mean?
My situation specifically is, I have a stories table, a storytags
table and a tags table. I want the user to be able to add a tag to a
story on a form, using autocomplete for a field in a table that’s not
the same as the primary table (stories).
If anyone can give me a push in the right direction, I’d appreciate
it.
Thanks,
Dino