# Forwarding to login-page fails for user-engine if used withi

**URL:** <https://www.ruby-forum.com/t/forwarding-to-login-page-fails-for-user-engine-if-used-withi/60481>\
**Category:** Engines\
**Created:** [May 14, 2006, 3:16pm UTC](https://www.ruby-forum.com/t/forwarding-to-login-page-fails-for-user-engine-if-used-withi/60481 "2006-05-14T15:16:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![justbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@justbe](https://www.ruby-forum.com/u/justbe)\
**Post date:** [May 14, 2006, 3:16pm UTC](https://www.ruby-forum.com/t/forwarding-to-login-page-fails-for-user-engine-if-used-withi/60481/1 "2006-05-14T15:16:20Z")

</div>

Hello there,

I am using the user and login engine in my application, and it works  
perfectly when used in ‘normal’ controllers, but when used in a  
controller  
like ‘admin/general’, it does not work properly, because when going to  
[http://localhost/3000/admin/general](http://localhost/3000/admin/general) I get the following:

Routing Error

Recognition failed for “/admin/user/login”

The admin/general\_controller.rb file looks like this:

class Admin::GeneralController \< ApplicationController  
before\_filter :login\_required

def index  
end  
End

Is there a smooth way around this without touching the original  
rails-engine  
files?

Thanks and all the best,  
-Joerg B.

---

<div class="post-metadata">

**Author:** ![justbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@justbe](https://www.ruby-forum.com/u/justbe)\
**Post date:** [May 14, 2006, 11:21pm UTC](https://www.ruby-forum.com/t/forwarding-to-login-page-fails-for-user-engine-if-used-withi/60481/2 "2006-05-14T23:21:26Z")

</div>

It’s quite possible that the login engine is redirecting to  
:controller =\> ‘user’, rather than :controller =\> ‘/user’ (the latter  
being necessary to escape out of user modules), though you’d need to  
check the code for that.

If that’s the case, submit a ticket and it’ll get patched up forthwith.

- james
