I have a simple page with one textfield and a submit button. I want a user to be able to enter a string, and have the submit button direct the user to a certain page, where the textfield is in the URL as the :id.
For example, if the user enters “test”, clicking submit should send him to “/controller/action/test”.
Is this possible? I tried:
<%= form_tag :controller => "myController", :action => "myAction", :id => :textFieldName do %> ...
but that does not work. (I didn’t suspect it would.)
Thanks
You’d have to use Javascript. In the simplest form
And then the handler should return and the form should submit to the new url.
Note that you should also validate/normalize the field’s content.