title: How can I get form_for to autopopulate fields based upon a non-model hash?
body: <p>I'm building a multi-step form in rails.  It's not javascript driven, so each page has its own controller action like "step1" "step2" etc.  I know how to do multi-step wizards through JQuery but I don't know how to keep rails validations per page without getting into javascript, hence this way.</p>
  
  <p>Anyways, my model is a <code>User</code> object but I'm storing all my variables in an arbitrary <code>Newuser</code> variable and using the following in the view:</p>
  
  <pre><code>&lt;% form_for :newuser, :url =&gt; { :action =&gt; "step3" } do |u| %&gt;
  </code></pre>
  
  <p>In the controller, I merge the current page's info with the overall hash using:</p>
  
  <pre><code>session[:newuser].merge!(params[:newuser])
  </code></pre>
  
  <p>This works great except that if the user clicks back to a previous page, the fields are no longer populated.  How do I keep them populated?  Do I need to change the object in the <code>form_for</code> to somehow refer to the session[:newuser] hash?</p>
  
  <p>EDIT:</p>
  
  <p>I guess I'm looking for more info on how form_for autopopulates fields within the form.  If it's not built around a model but an arbitrary hash (in this case, <code>session[:newuser]</code>), how do I get it to autopopulate?</p>