<p>So I have a snazzy custom route for login</p>

<pre><code># routes.rb
map.login '/login', :controller =&gt; 'sessions', :action =&gt; 'new'
</code></pre>

<p>Visit www.asite.com/login and you're there.  As is custom with failed login, however, we'll do the following in our action.  Note what happens on failed login.</p>

<pre><code> # sessions_controller.rb

 def create
   self.current_user = User.authenticate(params[:email], params[:password])
   if logged_in?
     # some work and redirect the user
   else
     flash.now[:warning] = "The email and/or password you entered is invalid."
     render :action =&gt; 'new'
   end
 end
</code></pre>

<p>This is very typical.  Simply render the new action and prompt for login again.  Unfortunately you also get with it an ugly URL: www.asite.com/session. Ick! Is it possible to get rendering to respect the original URL?</p>

Change
```
render :action => 'new'
```
to
```
redirect_to login_path
```