Before_filter halts chain but won't perform redirect_to properly

I have implemented a simple admin before filter like the one shown on at &

but I find that the redirect_to in my authorize function causes the the
Filter chain to halt and loop through 20 times with 302 errors trying to
redirect to home_path before it stops and does not render anything
this error

Filter chain halted as
@filter=:my_authenticate>] rendered_or_redirected.


before_filter :my_authenticate , :except => {:index, :show}


def my_authenticate
unless admin?
flash[:error] = “unauthorized access”
redirect_to home_path

if I comment out *redirect_to home_path *the app works, but non
normal users can access admin paths

any tips on why redirect_to breaks the filter chain so

i’m running rails 2.0.2

DHH says so I’d assume the
problem I’m seeing should be fixed



Based on the fact that it loops dozens of times, is this (or a similar)
filter possibly in effect for home_path as well? I.e.,

/issues/new -> filter -> /home -> filter -> /home -> filter … ad

that must be the problem…as the filter is in the same controller as
redirect controller – my root

so I guess the filter is being called over and over…

i’ll try a different tactic now…


On Wed, Apr 23, 2008 at 1:17 AM, Jan F.
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs