try this:
instead of ActiveRecord::Errors use ActiveRecord::ActiveRecordError,
class ApplicationController < ActionController::Base
rescue_from ActiveRecord::ActiveRecordError, :with => :method_name
private
def method_name
redirect_to your_path
end
end
----- Original Message -----
From: "slindsey3000" <slindsey3000@gmail.com>
To: "Ruby on Rails: Talk" <rubyonrails-talk@googlegroups.com>
Sent: Thursday, August 12, 2010 10:34 AM
Subject: [Rails] ActiveRecord errors ... Best way to rescue a live web
application?
> Hi all,
>
> I have some issues when a link is clicked twice quickly that deletes
> an ActiveRecord row.
>
> All I really want to do is set up some universal catch that will
> redirect all application errors to index.
>
> Best way?
>
> Thanks!
>
> Shawn
>
> --
> 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.
>
>
--
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.
No comments:
Post a Comment