You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I register a before_save that will apply to all of my models? I want to do something sort of like this:
ActiveAdmin.register ActiveAdmin::Resource::Base do
before_save do |obj|
obj.use_url_validation = true
end
end
Instead of repeating the before_save for every resource. This doesn't work but it does work when I register this for individual resources. Basically I don't know how to put code in the equivalent of ApplicationController when using active admin.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How do I register a before_save that will apply to all of my models? I want to do something sort of like this:
Instead of repeating the before_save for every resource. This doesn't work but it does work when I register this for individual resources. Basically I don't know how to put code in the equivalent of ApplicationController when using active admin.
Beta Was this translation helpful? Give feedback.
All reactions