title: What to render on error in a Rails controller
body: <p>In my rails application, I've got a partial view with an entry form on it. The form gets included on multiple pages across my app. The form in the partial posts to a RidesController to save with a create method like this:</p>
  
  <p>RidesController.rb</p>
  
  <pre><code>def create
    @ride = current_user.rides.build(params[:ride])
    if @ride.save
      flash[:success] = "Ride created!"
      redirect_to root_path
    else
      @rides = current_user.rides.paginate(:page =&gt; params[:page])
      render 'pages/home'   # &lt;---- WHAT GOES HERE?
    end
  end
  </code></pre>
  
  <p>I've commented the line where my question is. When we have an error, I need to present the same view that the user is presently on. But because this controller is being invoked from a partial instead of a full view, I don't know how to tell what context it's coming from.</p>
  
  <p>Right now if there's an error on /rides/new, the user ends up redirected to the homepage which also has the form.</p>