# Conditional URL in form post?

**URL:** <https://www.ruby-forum.com/t/conditional-url-in-form-post/92950>\
**Category:** Rails\
**Created:** [April 26, 2007, 12:15am UTC](https://www.ruby-forum.com/t/conditional-url-in-form-post/92950 "2007-04-26T00:15:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredrikbach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@fredrikbach](https://www.ruby-forum.com/u/fredrikbach)\
**Post date:** [April 26, 2007, 12:15am UTC](https://www.ruby-forum.com/t/conditional-url-in-form-post/92950/1 "2007-04-26T00:15:37Z")

</div>

Hello there,

I am trying to send a form post to different URLs based on the data  
submitted in the form (if the user selects credit card payment I need  
to send a form POST to a payment gateway, and if the user selects  
invoice payment type then I will process the form data within the  
Rails app). I have tried using Net::HTTP from the controller, which  
works well in sending a POST request with the needed parameters,  
however I am not directed to the URL I am posting to (which needs to  
happen to complete the credit card transaction).

Any help/ideas would be very much appreciated.

Thx,  
-Fredrik Bach
