I’m trying to do something which I think should be simple but can’t
find anything after reading and searching for quite a while. I guess
I’m searching using the wrong terms maybe.
I’d like to read the contents of a text_field_tag within a form from
within a controller function before the form is submitted. I could
possibly force the submission of the form but can’t work out how to do
A bit more explanation with an example:
Text box is empty.
User clicks button, “Hello”
“Hello” is appended to a session variable and then the text box div is
rendered and now contains “Hello”
User types: “John” (The form isn’t submitted yet)
User clicks button, “How are you?”
“How are you?” is appended to the session variable and the text box
div is rendered and now contains “Hello How are you?” (The “John” is
When the form is submitted the text is sent to a text to speech system
and is spoken on another web-page.
I would like to somehow read the contents of the text box when the
user click on one of the buttons and take into account any text the
user has typed.
Has anybody done something like this before or does anybody have any