Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activeadmin disabling the "new resource" method

I'm using Activeadmin for the admin interface on an app I'm working on (loving it) and I am curious if there is a way to disable the "New Resource" link in the upper-right corner of the resource show page?

The particular resource I'm using is nested inside another resource and I have a partial that allows it to be created from the show page on that parent resource.

I have disabled the resource in the menu, but I'd rather leave the resource in the menu so I can see/edit/delete those resources without having to find it by looking through its parent resource.

like image 247
YuKagi Avatar asked Oct 19 '11 00:10

YuKagi


2 Answers

Previous solution didn`t work for me, so here is general solutions, that works always:

ActiveAdmin.register Book do
  actions :index

  #or like that
  #actions :all, :except => [:destroy]

  index do
    column :title
    column :author
  end  
end
like image 71
makaroni4 Avatar answered Nov 04 '22 04:11

makaroni4


Try config.clear_action_items! to remove the link to New and other links on top of the table

like image 35
makvool Avatar answered Nov 04 '22 06:11

makvool