Tuesday, April 27, 2010

[Rails] Re: exception handling

Hi,


In application controller

rescue_from
ActiveRecord::RecordNotFound,ActionController::RoutingError,
ActionController::UnknownController,
ActionController::UnknownAction, ::NoMethodError,
:with => :handle_exception


# To handle Exceptions
def handle_exception
redirect_to no_access_url # redirect to a page with u need show
end


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate