Answer the question
In order to leave comments, you need to log in
Why doesn't it handle false in a callback in AA?
Droughty, Droughty, good afternoon.
There is ruby 2.1.4, rails 5, ActiveAdmin 2.0.0
ActiveAdmin has a callback:
ActiveAdmin.register Post do
before_save do |post|
post.errors.add :base, "You can't post this shit!"
false
end
end
Answer the question
In order to leave comments, you need to log in
Rails 5 fixed this and now you can't abort the save by returning false, but you can throughthrow(:abort)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question