0

I have a form and I need this form after sending redirect either to one, or to the other action. How to do that?

My first idea:

<%= submit_tag 'Send and redirect to the first action' %> 
<%= submit_tag 'Send and redirect to the second action' %> 

after sending I would check in the controller the value of the submit button and on the basis the value I would make a redirect to the needed action... but this solution is terrible...

Exist any better way to do it?

user984621
  • 46,344
  • 73
  • 224
  • 412
  • I believe this has already been asked: http://stackoverflow.com/questions/3027149/how-do-i-create-multiple-submit-buttons-for-the-same-form-in-rails Search is your friend. :) – summea Jan 27 '12 at 00:05
  • thanks for letting me know, I didn't use search (my bad). Well, the solution there is the same as I mentioned. But is not a nice solution, specifically in my case. Compare so long string is... you know. – user984621 Jan 27 '12 at 00:12
  • No problem. You can always make your string smaller... :) – summea Jan 27 '12 at 00:16

0 Answers0