I'm a n00b with Rails, and I'm trying to implement basic autocomplete
according
to Agile Web Dev w/Rails 3rd edition (p. 584-586)
I've installed the auto_complete plugin, added the statement
"auto_complete_for :game, :publisher" to my controller (Game is the
model, publisher the field I want autocompletion on),
and and put the following in my view template:
<%= f.label :publisher %><br />
<%= f.text_field :publisher, :size => 60 %>
<div class="auto_complete" id="game_publisher_auto_complete"></
div>
<%= auto_complete_field :game_publisher, :url => {:action =>
'autocomplete_publisher'} %>
and as suggested in another group, added:
map.resources :games, :collection => {:autocomplete_for_game_publisher
=> get}
to my routes file
I have the stylesheet included and (I think) all of the Javascript
libraries required.
The 1st error I get is :
undefined method `auto_complete_for' for GamesController:Class
and when I comment that line out, I get:
undefined method `auto_complete_field' for #<ActionView::Base:
0x47d2284>
What am I missing?
thanks in advance,
geoff
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---