# Ruby Form redirecting to edit page

**URL:** <https://www.ruby-forum.com/t/ruby-form-redirecting-to-edit-page/144815>\
**Category:** Rails\
**Created:** [August 2, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/ruby-form-redirecting-to-edit-page/144815 "2008-08-02T16:19:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [August 2, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/ruby-form-redirecting-to-edit-page/144815/1 "2008-08-02T16:19:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [August 4, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/ruby-form-redirecting-to-edit-page/144815/2 "2008-08-04T18:38:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [August 3, 2008, 2:56am UTC](https://www.ruby-forum.com/t/ruby-form-redirecting-to-edit-page/144815/3 "2008-08-03T02:56:07Z")

</div>

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.

On Sat, Aug 2, 2008 at 10:19 PM, Joe S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

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

–  
Ramon T.
