# Pass text\_field\_with\_auto\_complete value into link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/pass-text-field-with-auto-complete-value-into-link-to-remote/153624>\
**Category:** Rails\
**Created:** [November 19, 2008, 2:54pm UTC](https://www.ruby-forum.com/t/pass-text-field-with-auto-complete-value-into-link-to-remote/153624 "2008-11-19T14:54:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [November 19, 2008, 2:54pm UTC](https://www.ruby-forum.com/t/pass-text-field-with-auto-complete-value-into-link-to-remote/153624/1 "2008-11-19T14:54:39Z")

</div>

Hi,  
please any one tell me how can i pass the  
text\_field\_with\_auto\_complete value into link\_to\_remote in view. Here  
are the coding in view .  
\<%= text\_field\_with\_auto\_complete :game, :title%\>

link\_to\_remote(“Find”, :url =\> {:controller =\> ‘account’, :action =\>  
“findyourgame”},:with =\>"‘game[title]=’$(‘game\_title’).value")

In my account controller : i have a action called “findyougame”

def findyourgame  
## i here couldn’t get the value like params[:game][:title].  
end

Can any one please tell me how can i pass the text value and get in my  
controller by using link\_to\_remote. not form submit.

---

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [November 19, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/pass-text-field-with-auto-complete-value-into-link-to-remote/153624/2 "2008-11-19T15:05:43Z")

</div>

On 19 Nov 2008, at 13:54, Palani K. wrote:

> Hi,  
> please any one tell me how can i pass the  
> text\_field\_with\_auto\_complete value into link\_to\_remote in view. Here  
> are the coding in view .  
> \<%= text\_field\_with\_auto\_complete :game, :title%\>
> 
> link\_to\_remote(“Find”, :url =\> {:controller =\> ‘account’, :action =\>  
> “findyourgame”},:with =\>"‘game[title]=’$(‘game\_title’).value")

Your with clause is messed up (it needs to be syntactically correct  
javascript). You’re probably get a javascript error somewhere when you  
click on the link.  
Something like “‘game[title]=’ + $(‘game\_title’).value”  
would probably work better.

Fred
