It took a little bit, but I finally got the error handling to work just the way I wanted it to:
def rescue_action_in_public(e)
case e
when Exception::UnauthorizedAction
redirect_to :controller => 'main', :action => 'unauthorized_action' and return false
else
return super
end
end
This approach basically allows you to ‘extend’ the base ActionController.rescue_action_in_public() method.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.