docs/8-custom-actions.md in activeadmin-0.4.0 vs docs/8-custom-actions.md in activeadmin-0.4.1
- old
+ new
@@ -90,9 +90,15 @@
action_item :only => :show do
link_to('View on site', post_path(post)) if post.published?
end
+Actions items also accept the :if option to conditionally display them:
+
+ action_item :only => :show, :if => proc{ current_admin_user.super_admin? } do
+ "Only display this to super admins on the show screen"
+ end
+
### Page Titles
The page title for the custom action will be the internationalized version of
the controller action name. For example, a member_action named "upload_csv" will
look up a translation key of "active_admin.upload_csv". If none are found, it