Login problems with redirects

Login problems with redirects

Using Ruby on Rails 3 with Devise for authentication.
* All pages (except sign-in, sign-up, etc) are behind authentication
* My "home" page contains multiple jQuery Mobile "pages".


When the user tries to visit the root / home, they get redirected to login. After the user authenticates, they are redirected back to the root url. The root path contains multiple jQuery Mobile pages. 

Root URL attempt:  http://localhost:3000/
     - redirects to -
     - after authentication, user is redirected to root path but gets... -

The page shown is the last "page" in the multi-page list.

Forcibly changing the URL to the desired root ( http://localhost:3000/), the application then works fine.


Is there a way to conditionally handle redirects as "rel='external'" or something similar? Has anyone found a solution for this problem?

-Mark E.