Where is the value in the text field coming from? If it's coming from
your app (e.g. from the database or from a user passing parameters),
then you can do this on the Rails side of things, and it seems most
likely that you want to set an instance variable in the controller
(e.g. @text_field_value = [value]), which you can then use in both
your link_to and text_field. If you want the text field to
dynamically update as the value of the text field is changed, then you
should use Javascript, such as something along these lines:
Hi John,
I have a similar requirement.
I need to pass the value of a text field with link_to
What I'm doing is:
<%= link_to "Go", {:controller=>'main',:action=>'searchcontc'},:onclick
=> "this.href +='?uname='+encodeURIComponent($F('name')); return true"
%>