I've got a situation where I have some controllers
nested one level deeper than "standard":

 app/controllers/nestfolder/blah_controller.rb

I'm also running the restful auth package.

The problem I'm having is that restful auth is not creating
redirects correctly given the nesting structure.  I'm still
at the beginning, so I'm starting with the :login_required
before_filter.  This calls access_denied to redirect to the
login page:

 def access_denied
   ...stuff...
   redirect_to :controller => 'sessions', :action => 'new'
   ...
 end

The problem is that when this is triggered from one of the
nested controller actions, the :controller in the redirect
automatically inherits the nesting, so the app tries to
redirect to "nestfolder/sessions", which is incorrect.

I've found that I can get it to generate the correct redirect by
specifying :controller => "/sessions".
My question is, what is the "right" way to fix the problem?
Hunt down all the redirects, url_for calls, link_to
calls etc. in Restful Auth and modify them?  Anyone know of
any alternatives?

Maybe I'm not doing the controller nesting correctly?  I used
radrails to do a "generate", which appears to be the same as
"script/generate nestfolder/blah_controller".  Am I just asking
for trouble by nesting controllers one level deeper like that
in general?

Thanks for any insight or advice.

                -glenn
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to