# Text\_field\_with\_auto\_complete nonsense (newbie question)

**URL:** <https://www.ruby-forum.com/t/text-field-with-auto-complete-nonsense-newbie-question/64425>\
**Category:** Rails\
**Created:** [June 25, 2006, 8:08pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-nonsense-newbie-question/64425 "2006-06-25T20:08:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nightdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7cd45c/32.png) [@nightdog](https://www.ruby-forum.com/u/nightdog)\
**Post date:** [June 25, 2006, 8:08pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-nonsense-newbie-question/64425/1 "2006-06-25T20:08:29Z")

</div>

Hi everyone,  
I have been introduced to ruby on rails a couple of days ago and it  
really brings out the fun in programming for the Web. I’m trying to  
implement a text\_field\_with\_auto\_complete as described in  
[script.aculo.us](http://script.aculo.us) , as follows:

controller:  
class SearchController \< ApplicationController  
auto\_complete\_for :recipe, :name  
end

search.rhtml:

\<%= javascript\_include\_tag :defaults %\> \<%= text\_field\_with\_auto\_complete :recipe, :name %\>

The result, however, is an unresponsive site, with the following output  
from LightHTTPd:

Processing SearchController#auto\_complete\_for\_recipe\_recipe\_name (for  
127.0.0.1 at 2006-06-25 18:56:27) [POST]  
Session ID: 7e424000d0d368532915e019f3e2c27f  
Parameters: {“action”=\>“auto\_complete\_for\_recipe\_recipe\_name”,  
“controller”=\>“search”, “recipe”=\>{“recipe\_name”=\>“u”}}

NameError (uninitialized constant Recipe):  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/inflector.rb:161:in  
`constantize' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/string/inflections.rb:59:in `constantize’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/macros/auto\_complete.rb:44:in  
`auto_complete_for_recipe_recipe_name' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in `perform\_action\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:368:in  
`perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue’  
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/rescue.rb:82:in  
`perform_action' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in `process\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:377:in  
`process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in `process’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in `process\_request’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:54:in  
`process!' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each\_cgi’  
/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in `process!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:23:in  
`process!’  
/Users/nightdog/insert/public/dispatch.fcgi:24

Rendering  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/templates/rescues/layout.rhtml  
(500 Internal Error)

Any ideas on what could be wrong? I tried a Recipe.search on the console  
but it gives me the same error.  
My database has a ‘recipes’ table with an id and a name string.

Thanks in advance,  
Ricardo

---

<div class="post-metadata">

**Author:** ![nightdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7cd45c/32.png) [@nightdog](https://www.ruby-forum.com/u/nightdog)\
**Post date:** [June 25, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-nonsense-newbie-question/64425/2 "2006-06-25T20:36:14Z")

</div>

script/generate model recipe … 🙂
