title: Rails form without a model
body: <p>I'm making a super simple app that is essentially just a controller and some views. I can't figure out how to make the form submit and then redirect to the another action.</p>
  
  <p>Here is my code:</p>
  
  <pre><code># app/controllers/wizard_controller.rb
  
  class WizardController &lt; ApplicationController
    def calculate
  
      # process data from form here
  
      redirect_to controller: 'wizard', action: 'show'
    end
  
    def show
      # print processed data here
    end
  end
  </code></pre>
  
  <p>This is what the <code>wizard#calculate</code> view looks like:</p>
  
  <pre><code>&lt;div class="alert alert-info"&gt;
      &lt;h2&gt;Get advice on where to live in 3 easy steps!&lt;/h2&gt;
  &lt;/div&gt;
  
  &lt;br/&gt;
  
  &lt;%= form_tag(:controller =&gt; "wizard", :action =&gt; "calculate") do %&gt;
  
   ... form fields ...
  
  &lt;%= submit_tag("Submit") %&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>At this point, just going to <code>/wizard/calculate</code> redirects to <code>/wizard/show</code> right away since there isn't a conditional statement before the <code>redirect_to ...</code> line.</p>
  
  <p><strong>Edit: Solved using responses on twitter</strong>
  I was basically trying to get form data and process it all in the same action. I solved this by splitting <code>calculate</code> into <code>setup</code>, the view that has the form and <code>calculate</code> where I process the data and redirect to <code>show</code>.</p>
  
  <p>Also, <code>&lt;%= form_tag "/wizard/calculate", method: "get" do %&gt;</code> helped submit the form data accurately.</p>
  
  <p>Thanks for all the responses, it helped a whole lot to get to understanding how this works in rails.</p>