# Text\_field\_with\_auto\_complete without a model

**URL:** <https://www.ruby-forum.com/t/text-field-with-auto-complete-without-a-model/183179>\
**Category:** Rails\
**Created:** [February 9, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-without-a-model/183179 "2010-02-09T17:05:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [February 9, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-without-a-model/183179/1 "2010-02-09T17:05:11Z")

</div>

hi-

is this possible? basically, i have a simple search text box whose  
contents i want to send to my server to suggest a query. that  
suggested query will be in turn retrieved from a 3rd party API. I  
cannot figure out for the life of me how to use  
text\_field\_with\_auto\_complete without a model. basically, i want a  
text\_field\_tag and NOT a text\_field to have autocomplete functionality  
with my own custom controller method.

thanks for any help,  
dino

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [February 9, 2010, 9:12pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete-without-a-model/183179/2 "2010-02-09T21:12:48Z")

</div>

I found the answer- you put a text\_field\_tag in first and then the  
autocomplete div, and then auto\_complete\_field

```
      <%= auto_complete_field "text_box_id", :url => {:action =>

```

‘auto\_complete’}, :method =\> “GET” %\>

(the method part fixes the invalid token problem)

hope this helps someone down the road.

dino
