<input type="text" id="activity_lookup" name="activity_lookup" />
<div class="auto_complete" id="activity_lookup_auto_complete"></div>
<%= link_to ' Search ', :action => 'show_activity', :name => ???%>
I would like to pass the name as a parameter to my action. The name
should be the value of the input field with id 'activity_lookup'.
I did not find a solution on how to do this :s
include javascript ? javascipt_tag ? (tried this, but did not do the job
... )
As you will guess : I am using this bit of code for an auto complete
field (example from the rails recipes book)
Is there a nice way to do this ?
Am I looking in the wrong direction and is it much easier ?
Thx for your help.
--
Posted via http://www.ruby-forum.com/.
this is working for me:
<%= link_to 'Search', {:action => 'show_activity', :name => 'Dieter' }
%>
Note: Check how to pass arguments to "link_to" in http://api.rubyonrails.org/
In your case it's take name as the html_options so it will rendered as
an attribute of <a> tag like this
<a href="http://example.com/controller/some_action" name="dieter"/>
I guess this answers your question.
On Aug 24, 5:11 am, Dieter D'haeyere <rails-mailing-l...@andreas-
this was not what I meant.
I want to pass the value of the input field with id "activity_lookup"
Whay you are saying is something very static.
I was thinking in the direction of :
:name => javascript_tag('document.elementById("activity_lookup").value')
But that doesn't work.
The 'name' I want to pass is the value of the input field ...