I'm having a weird problem were it looks like Activescaffold is displaying two error warnings when postgresql throws a database error.(on destroy in this example.) I posted a screenshot.
The first error (yellow message) displays what I expect to happen, where
text from en.yml is displayed for the cant_destroy_record in do_destroy.
here:
module ActiveScaffold::Actions
module Delete
def do_destroy
destroy_find_record
begin
self.successful = @record.destroy
rescue
flash[:warning] = as_(:*cant_destroy_record*, :record =>
@record.to_label)
self.successful = false
end
end
and in my /config/locales/en.yml
en:
...
active_scaffold:
...
# error_messages
cant_destroy_record: "%{record} can't be destroyed! <<My Custom
Message!>>"
---
The second error (red bar) displays under the first, contains no text and
requires a click to close. Where is that one coming from, how do I stop it
from displaying?
I thought this might be a result of not handling the Pg::error so I tried
something like this in my application Controller.
rescue_from PG::Error do |exception|
puts "foo"
end
Didn't help!
At this point I'm trying to figure out how to rescue a PG error without
activescaffold displaying two error bars.
Thank you for any advice.
env
Rails 3.2.8
Ruby 1.9.2
pg 0.14.1
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/activescaffold?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
<<attachment: 2_error_bars.jpg>>
