title: Rails - how to pass created record from the new form to a redirected page
body: <p>I think this is a pretty simple question but nothing I've read has answered my question directly:</p>
  
  <p>I have a new products page with a standard form. After successfully submitting the form, I redirect to a custom controller action and view called "thanks".</p>
  
  <p>On the "thanks" page, I want to be able to print the name of the product just created and possibly some other attributes.</p>
  
  <p>How do I pass the object just created into my new action? Right now the controller looks like this:</p>
  
  <pre><code>def create
      @product = Product.new(params[:product])
      if @product.save
      flash[:notice] = "Successfully created Product."
      redirect_to thanks_path
      else
      render :action =&gt; 'new'
      end
  end
  
  def thanks
  end
  </code></pre>