Forum: Ruby on Rails Rails newbie question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7af5f9ead5cf07153f34e6f93c2eff95?d=identicon&s=25 Dave (Guest)
on 2006-01-06 21:50
Ok, I've got an autocomplete dropdown, and what I want to do is get the
value selected from the dropdown, and then render a link_to that will
pass that value (:id => ???) to a controller method. Can I do this all
in the partial (like I'm attempting below), or do I have to go from
text_field_with_auto_complete back to the controller, then render the
link_to in another partial?

The dropdown part works fine, btw. I'm just having trouble accessing
it's value.

<%= text_field_with_auto_complete :patient, :name,
        {}, :skip_style => true,
        	:url => {:action => "auto_complete_for_patient_name",
        		      :cohort_id	=> @cohort_id
        		    }
%>

<%= link_to "add", { :controller => "foobar",
                     :action => "get_patient_info",
                     :id => ??? },
                     :class => "nav"
%>

Heeeellllllp!!!!!

thanks in advance,
Dave
This topic is locked and can not be replied to.