Forum: Ruby on Rails link_to_remote with form values?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Se W. (Guest)
on 2006-04-12 22:47

I need a way to read a form field and pass its contents as a parameter
to a link_to_remote call.

So let's say I have a textarea input:
<%= text_area 'course', 'topics', :rows => 6, :cols => 60  %>

and later a link_to_remote:
<%= link_to_remote("Hide",
                  { :update => 'my div',
                    :url => {:action => 'hide_textarea', :div =>
                    :course => @course } ) %>

and I want to add the contents of the course_topics textarea as a field
in my :url hash.

Getting the form value with javascript should be possible, but how do I
embed that into the ruby code?

Craig J. (Guest)
on 2006-12-04 19:07
I actually have the very same question and have been trying to figure
out a solution for the last hour.  Any help would be appreciated.
This topic is locked and can not be replied to.