Ruby Form redirecting to edit page

I am trying to create a form that will allows a person to enter a
predetermined code.

Once they submit the form with the code, they will be taken to a survey
that corresponds to the code that they have entered. If the code they
entered does not have an associated survey, an error message will be
displayed asking them to reenter the code.

If someone could provide a bit of code demonstrating how the form should
be constructed, I would greatly appreciate it.

Please detail which action and controller the form will take make use
of. (that's one of the things I'm finding most confusing about ROR
forms!)

Thank you in advance for your help.

Well, best to evaluate this code in the controller, or better yet, in
the model handling this thing.. then the output is what what you
forward your user to.

FormController: Hey model, they entered this code. What what do you say?
FormHanlder(model): That code points to this form.
FormController: thank you! I'll go send the user to that form.

Thank you for your help.

Could you please provide a bit of code showing how the form should
specify which controller and action within that controller will handle
the submission?