Hi Everyone,
I want to redirect the user to login page, when he is trying to use
access unavailable page. Usually it throws me a exception error and 404
page.
But here when user got 404 error he will be redirected to login page, I
modified the method perform_action under the file
/vendor/rails/actionpack/lib/action_controller/base.rb
as follows:
def perform_action
if self.class.action_methods.include?(action_name)
send(action_name)
default_render unless performed?
elsif respond_to? :method_missing
method_missing action_name
default_render unless performed?
elsif template_exists? && template_public?
default_render
else
#the coding was changed for to avoid 404 errors on 06/04/08
#flash[:notice]="Seems that the page you were looking for does not
exist, so you’ve been redirected here."
redirect_to :controller=>‘account’, :action=>‘login’
#raise UnknownAction, “No action responded to #{action_name}”,
caller
end
end
Its working well shall I override this function in my application
controller or in some where my app files cos its now in vendor folder,
regards,
veeraa