I recently ran into a bug at work, I was trying to submit a form that had some hidden variables and when the form would fail saving it would call render :action => "new", which sent the user back to the form on the "new" page.  This is fine but since the form had some hidden fields that were being set by parameters being passed on the url, the hidden fields would fail to get set, causing the object to get saved but without some very important attributes.

I did some searching and found out that if I wanted to preserve the parameters when a form failed, I would have to set them in the form_for method call, with the url key, like this:

form_for(@product, :url => { :action => :create, :type => params[:type], :name => params[:name] }) do |f|

After setting the type and name like this, the parameters were successfully retained.