gregbell/active_admin — Issue #1073: One action, Multiple namespaces
Author: acurley
Created: 2012-02-26 17:56:07+00:00
State: open

I am having difficulty understanding how to write actions DRY-ly. Given that I have two namespaces (public and private) but I want the same action to be available to both namespaces, I cannot see a way around using the same member_action code in both locations.

```
ActiveAdmin.register DigitalAsset, :namespace => :public do

member_action :copy do
# Logic for copying
end
end
```

```
ActiveAdmin.register DigitalAsset, :namespace => :private do

member_action :copy do
# Same logic for copying as used above in 'public' namespace
end
end
```

It would seem obvious that I would want to define the 'copy' action in one controller that is available to both namespaces. Is this something that is possible using ActiveAdmin 0.4.0?